Did you get it through airport security or are you simply postulating on the possibilities?
Boundary lines and borders officially go from the ground up with no upper limit... not like a fence you can jump over. That's why nations get so bent out of shape when some other country fires a missile through their airspace. I think they kind of agree that something in orbit gets a free pass..... but we do have folks who track all those things up there so we know who's got some hardware in our airspace.
The biggest issue I would think would be getting it through the security check points because it's still a federally regulated substance. So, according to the feds, you can't have it anywhere, but the current administration is turning a blind eye to the states which permit it. However, people have been smuggling it for decades.
The cop on the ground isn't going to know or really care that you're flying over his state with weed..... however, what would happen if the plane had to make an emergency landing in one of those flyover states ( engine issues, smoke in the cabin, some fool gets drunk and acts up, medical emergency, or some other idiot calls in a bomb threat on board the plane) and everyone on board had to be rescreened in one of "those" states?
The way your luck tends to run..... you'd be standing in the line, and there would be a K9 officer walking Jax the drug dog down the line.....and he would come to you.... take one sniff, and sit. Possession of a prohibited schedule 1 narcotic, intent to sell, manufacture, distribute, etc, etc, etc.......
Yeah..... I'd just carry some money or a credit card and buy some at the destination.