The yellow stuff is most likely an infection.
One of these:
https://www.merckvetmanual.com/poultry/disorders-of-the-reproductive-system
Most likely...
https://www.merckvetmanual.com/poul...eproductive-system/egg-peritonitis-in-poultry
Are you in the US?
Each state has a lab where you can get a necropsy performed to find out exactly what is going on.
I am very curious as to what you feed your flock on a daily basis.
If you feed daily treats I highly recommend stopping and only offer your birds a complete balanced diet of crumbled or pelleted type feed.