Being able to use a second carrier without cancelling a contract with the first is useful for international travel; the 'roaming' rate is often much higher than the normal rate of other countries' local telcos. Plus, mixing-and-matching plans can be advantageous to the user in certain situations even within one country. For example, data-only plans are typically cheaper than data+calls, but one might still want a very modest calls plan for infrequent use - sometimes, better value can be attained by combining two separate contracts. Of course, whether or not telcos ought to allow such use of their contract handsets is another question entirely!
If there’s a big enough market for this use case, I suspect at least one carrier would do so. I’d imagine this would include some sort of payment in escrow, temporary unlock feature, or an optional add-on.
Otherwise, folks in this position should just buy the phone outright and unlocked so they don’t have any issues like you’re describing.