When villagers want to share food for breeding they throw away entire supply of item they are giving away.
If you give food to one villager, they will be throwing it back and forth.
You need to give food to villagers separately in order to breed them.
I duplicated this bug on video using a data pack that shows inventory. It does appear that when throwing food back and forth the food just disappears. Even if both villagers have food, when they throw to a hungry baby the food sometimes disappears for everyone. I did NOT document that giving them food separately will fix this. Here is a link to my 3 minute video showing what is hopefully the bug. https://youtu.be/ykBSqq0gvQw