first quick question why are you using Retpibark for a desert animal?

If humidity is too high it can cause infections, also if the bark shifted as some point your dragon could have mistaken it for food. (hell mine mistook a piece of shedded skin for food cause it moved a little)... Since Bearded dragons have somewhat sticky tongues it may be a little hard for it to push the bark out of its mouth.

I would recommend switching to either a repticarpet or calcium sand, and watching the humidity levels. Set up a vet appointment to see about getting rid of the infection.