I don't think the peptides in food are even active in the gut. After stewing in hydrochloric acid and exposure to various protease enzymes I don't think anything is left but amino acids.
Certainly I think it would be easy to see if they did have any effect. Bake some muffins or something and add an obnoxious amount of blue food dye. Eat one and note the time. Then when you take a poo check and see if it's a funny colour. That can tell you your gastric transit time. Then cut out wheat/rice/milk etc. for 24-48 hours and see if your gut speeds up.
If any of these foods were active as opioids then would they not be an obvious treatment for opioid w/d?
Any peptides would survive pasteurization. I personally don't find milk to be sedating.
It would likely need to be administered IV/IM/SQ or perhaps even intrathecally but it should produce typical opioid effects.
beta-endorphin is active when injected but as I understand it, morphine is still easier to produce industrially.