Even prisoners walk back into their cells. Comfort doesn’t erase confinement.
A bird’s world is the open sky—so an open door doesn’t make a cage any less of one.
That's oversimplifying the topic to some catchy lyrics' lines level.
Birds burn a ton of energy flying (at least the birds in question here, other birds can glide for long times), it's not something they would willingly do to no ends.
Plenty of small birds do not nest in tree cavities. Chipping sparrows[1] for example do not and are of similar size. Hummingbirds also do not. Meanwhile, owls live in nest cavities and most are larger than songbirds.
That said, the going theory about why some birds choose to nest in cavities is lower mortality rate in their young. Birds who nest in boxes typically have more babies per clutch than those that do not so perhaps that's it? I take that more as no one really knows why one species does while another of similar size does not.
Another random observation is most large birds walk and smaller birds hop. That's not always true either, since blue jays hop and crows will walk and sometimes hop. Hummingbirds cannot do either and just shuffle side to side on perches.
I guess I'm trying to say there's exceptions to the rules in bird behavior, but they're more outliers.
I reckon that’s right (though maybe its mostly instinct rather than explicit worry), and I imagine there’s also the risk of being kicked out by a larger species looking for a nesting site.