Ah ha! I tried this out with various old versions of Trio and found that it prints “should not be here outer” in 0.10.0 but does not in 0.11.0. Sure enough, there’s an entry in the release notes for 0.11.0:
trio.Cancelledexceptions now always propagate until they reach the outermost unshielded cancelled scope, even if more cancellations occur or shielding is changed between when theCancelledis delivered and when it is caught. (#860)
That text in the docs was there in 0.10.0 docs so it just wasn’t updated when the behaviour changed.