Pepcid doesn't work as well as Zantac so I don't know what would have happened if I had to stop PriloSec immediately and go to Pepcid. Zantac has been banned so that's not an option. If you can cut the Prilosec pills in half then maybe transitioning from Prilosec to Pepcid over a few days might work.
I titrated from 40 mg, my usual dose, to 20 (one capsule), and introduced 20 mg famotidine at that point, still had a hard time. But I am fortunate in that the 40 mg PPI totally alleviates my symptoms.
Tagamet is a drug similar to pepcid, and it is over the counter, but you probably weren’t taking enough pepcid. My doctor okayed 40mg per day, which was the IV dose we used to give in the hospital. Pepcid works great for me IF I take 40mg.