As I mentioned earlier, Illustrator does retain the PDF settings, but InDesign doesn’t.
It’s possible you might be remembering it differently, or I could be mistaken myself. There are a few threads about this already, and the Adobe help docs also point in that direction.
If I’m wrong, I’m happy to hold my hands up, but in my 25 years of using InDesign I’ve never seen the PDF settings stored with the file. In fact, it’s something that’s even been raised in the official feature request forum.
I’m not trying to say one of us is right and the other is wrong. I just think the evidence, along with my own experience and what others have shared, supports the idea that this is how InDesign has always worked.
It might be different in 2024 and 2025 i can test tomorrow.
Again if I'm wrong that's fine. I'd like to know too.