The ones with the rubber seals keep air in. A lot of new cars have those and a lot of cars with tire pressure sensors require them. Regular covers without the seal don’t keep air in obviously but I still wouldn’t trust the ones 3d printed by a random person because I don’t know what their QC is. The ones that go over original covers are the best either way.
I see where you’re coming from but “Metal, and some higher quality hard-plastic valve stem caps, often have a rubber washer or seal inside to help make an airtight seal. This type of cap protects from dirt and moisture and also helps prevent air from escaping from a slightly leaking Schrader valve.” (https://www.bluestar.com/get_informed/article/tire-valve-stem-caps-do-your-tires-need-them)