It seems to me there are three options.
(1) Prisons that are narrated always have bars, small gaps, etc such that shapechanging PCs can escape them (ie can never be held in prison).
(2) Prisons that are narrated never have bars, small gaps, etc.
(3) Prisons that are narrated sometimes have bars, small gaps, etc; and sometimes not. Given that my setting is a trad fantasy one where timber is more prevalent than worked metal, (3) seems the most logical.
Then, within 3, there is the question - how do we decide which prisons are which? We might roll % dice. BW has a mechanic for that (called the "die of fate") but it is not a major part of the system, because it only comes into play when other considerations that would inform framing and resolution are exhausted.
Another way to decide would be via action declaration and resolution: the player could have tried to roll an Architecture or similar check to discover the gap his falcon-form can fly through. But he chose not to - presumably because he suspected he wouldn't succeed at that.
Given that a DoF was not appropriate, and that the player didn't declare any action relevant to the construction of the prison, my framing stands. It's a consequence of failure; hence, you didn't get what you wanted (ie you're not getting where you wanted to get with your bodies); hence you can't just fly out in falcon form and negate the failure. You're going to actually have to deal with the failure. (Which he did: he created an illusion of himself and the other prisoner; turned the two of them invisible; and then the assassin tried to pick the lock, taking the time to make the attempt with care. Unfortunately that check failed, and so - per the rules of the game - I am entited to impose a major time-based complication (due to the taking of the bonus for a careful attempt). That was the cliffhanger on which we finished our short session last Sunday.)
Not that it matters in the specific discussion, but there's a fourth option (among, as I'm sure, others):
In my campaign it's explicitly stated that in a world where things like magic and shapeshifting exist, that something like the simply prospect of imprisoning somebody is different than in our world. Suspected spell casters, or possibly everyone, is bound and gagged, often in a position that makes it difficult to overcome (such as chaining them in a spread eagle position on a wall). In addition, it's also noted that a reason for the druid's unwillingness to wear metal armor is that wearing metal can interfere with their druidic abilities, including shapeshifting. Metal manacles are enough to prevent this.
Not all locations will take all such precautions against all prisoners. But the fact that the world addresses imprisonment differently in a mundane way, not to mention potential magical precautions, means that they aren't always going to have an easy chance of escaping by spell or shape changing.
Overall, I'm more concerned with developing an internal consistency within the world, so the players have a framework to understand it a bit better. On the other hand, most jails are designed to hold "most" people, and particularly the types of people that are regularly imprisoned in that town, city, etc. So they may not have sufficient protections against higher level spell casters, every type of spell caster, or every special ability.
Defenses against flying creatures and spells is another thing that many have to be prepared for, as another example. Town armories typically have a supply of silver arrows on hand in the event of a lycanthrope attack is another.
Regardless, and important factor is to frame things and set expectations so the players have a good base of understanding to make decisions. Even if something wasn't explicitly described before hand, if you're good at setting expectations and establishing trust with the players, then when there is a new situation that is a bit of a surprise, it's not viewed as a punitive attempt to shut down a character's special ability.