Vomiting and difficulty in defecating requires an experienced avian vet.
There are lots of potential causes and no one here can work out the cause or offer advice on treatment. We're not vets and even if we were, we haven't examined your bird. Birds can go downhill very quickly so it's essential that your bird is seen as quickly as possible.
What is the diet ? You may need to switch from the powder to the liquid diet.
Agree..veterinarian..their diet is so prone to spoilage that an infection of some sort either bacterial or yeasts/fungal is easy to get and both require meds from a veterinarian if thsts what's going on.