I've read multiple times (over the years) that swifts are known for sleeping while in flight during their migrations between Africa and Europe. The best reference I could find right now is https://www.nationalgeographic.com/science/article/three-swi... which doesn't confirm but strongly implies (presuming a bird cannot go for 200 days without sleeping, and it was apparently up in the air all that time, it must have been taking "power naps" in mid-air).
But some birds can use tricks to fly without flapping, and I'm pretty sure some birds can sleep aloft.
https://news.mit.edu/2017/engineers-identify-key-albatross-m...