Can you do an OS upgrade on a locked device without unlocking it first ? If so that is terrible regardless of whether the OS partition is encrypted or not.
It also doesn't really matter whether the compromise is a direct key extraction or just defeating the anti-bruteforce protections, the root flaw here is with the phone accepting new privileged software while locked and still retaining its state.