Linux allows polling without any events specified and it happens to be the case in FreeBSD as well. POLLHUP has to be delivered regardless of the event mask and this works fine if the condition is already present. However, if it is missing, selrecord is only called if the eventmask has relevant bits set. This in particular leads to a conditon where pipe_poll can return 0 events and neglect to selrecord, while kern_poll takes it as an indication it has to go to sleep, but then there is nobody to wake it up.
The problem is reported here with a reproducer: https://lists.freebsd.org/pipermail/freebsd-hackers/2020-November/056685.html
While the problem seems systemic to *_poll handlers the least we can do is fix it up for pipes.