The entire point of seniority-based systems like the ones that many teachers unions have negotiated is to protect long-serving teachers from losing their jobs when the budget gets tight.
Both teachers and principals had to accept each other, or teachers would be on the payroll without a permanent position, often serving as long-term substitutes.