Cars are an example of that. Even when scarcity has driven the cost of cars up (such as during the recent pandemic), everyone recognized that more could, and would, be produced, and so no one viewed them as an investment vehicle, that adding time in somehow increased the value over the initial purchase price.
Housing is viewed that way. Part of that is due to location; there is innately a level of scarcity (not everyone can live in (insert city)), but there is also massive artifical scarcity. Even where there's room, there is NIMPYism and zoning regulations and etc that keeps enough housing from being built in areas people are able to live (i.e., close enough to civilization to be able to buy groceries without an hour long drive each way, for instance), forcing pricing up, in a positive reinforcement loop (scarcity = pricing goes up = people buying for the 'investment' rather than a place to live = more scarcity)