Bees will "try" to pathfind through closed doors, trapdoors and gates, even though they can't go outside of it. Other mobs don't do this.
Linked issues
is duplicated by 1
relates to 2
Attachments
Comments 6
Can confirm in 21w03a.
Can confirm in 1.18.1 and 1.18.2, they also try to path find through glass panes.

Can confirm with 22w11a

Affects 1.20.1
Can confirm in 1.20.3 Pre-Release 1
Can confirm in 20w51a.