The same happens in 1.21.11 with both ceiling (when Allays fly up) and floor (when Allays land) trapdoors. Also baby villagers exhibit the same behavior with floor trapdoors.
Baby villagers also seem to be affected by this behavior.
Tested in Survival - same behavior.
Screenshots are provided in my ticket: MC-305281