I actually had a solution for that way back when OTA was converting to digital, and filed comments with both the FCC and the ATSC which were rejected.
Give all the major networks a nationwide primary PSIP channel number and require affiliates to encode the streams of those networks by that PSIP. Then, when affiliations change, it's a matter of stations changing the encoder and viewers rescanning, and voilá! The networks are still on the same "channels".
I also suggested that cable systems should shuffle channels when there are affiliation changes, so that at least those people still subscribing to cable would find their network programs in the same place, but it's probably too late for that to happen since that market is dwindling. (Come to think of it, if NAB and the stations have their way regarding encryption, ATSC 3.0 is likely to shrink the OTA viewing market as well.)