My wife has near constant heartburn, and especially after eating oily and greasy foods.
The problem may be you have Acid-reflux disease:
Ah, one of over 50 of Dr. Cooper’s sphincters.
Yeah, I was going to say this sounds more like acid reflux than food going “rancid”. Packaged, processed foods usually take waaaaaaay longer than the “sell by” date to actually go bad.
You need to have your Gall Bladder checked out. I’d make book on it.