Good Info!! Thank you for sharing!!What you are describing my boy is currently recovering from... gastric ulcers. His developed due to stress and being on many medications due to having three surgeries/hospitilized for other problems. Anyways, after he came home the last time
He wouldn't stop puking(often yellow bile if he had not eaten, or foam), couldn't eat, blood in his stools. They thought it was esophagitis from the endotracheal
Tube during surgery, so they scoped him to have a look. Turns out it was gastric ulcers. He had every test under the moon - blood tests, ultrasound, barium swallow, etc. they had no clue it was gastric ulcers until he was scoped. It may be a different diagnosis in your case, but I really suggest you ask your vet about that possibility. He is now on a new easy digestible food (just while he heals), antacids, and a pill that coats his stomach. We haven't had puke in awhile thankfully!