This behavior was introduced in 26.1-snapshot-3.
Steps to reproduce
Place down a note block.
Summon an allay and give it a cake.
Throw a cake on the ground and use the note block.
Observed behavior
The allay will pick up the second cake and drop it at the note block, but the "Birthday Song" advancement will not be granted.
Expected behavior
The "Birthday Song" advancement would be granted, as was the case in previous versions.
I can confirm this issue