I've resolved my problem, but I'd like to get the opinion of someone who understands this stuff better, on what was going on.
Starting last night, I was having a connectivity issue (Pixel 7 Pro, carrier Tmobile). Wasn't getting texts. Set the problem aside until this morning, at which point I realized my phone was saying something like "no sim emergency calls only". I tried restarting a few times, reseating the sim, cleaning it etc. No luck. So then I tried it in my old phone. That phone also didn't recognize the sim card.
I was all set to go down to the TMobile store to get a new SIM card, when I decided to try one more thing. I went back to the old phone, ran Google Play, checked for updates, and installed the TMobile updates that were there. Shut down the phone, put the card back in that phone and started back up, and I had a cellular connection again. So them I moved the card to my Pixel 7 Pro with GrapheneOS, and I have cellular there too.
So my assumption was TMobile did something such that I needed their update for my SIM to work on their network. But I wasn't aware of any update occurring on my GrapheneOS phone. I guess it's possible I just missed it, but I'm not sure how to check (is there some kind of updates log?)
So is it possible that the updated tmobile app on on my old phone updated something on my SIM card that made the tmobile network accept it, including when used in my GrapheneOS phone? (In which case keeping the old phone around for such future "fixes"may be important.)
If that doesn't make any sense, then the last possibility is something being unreliable about the card, and it just being coincidence that it started working again...but it seems like a big coincidence...