Which is why unless the item is bog standard cornflakes, motor oil, toothpaste, etc. I assume “3 left in stock” means “3 left from this vendor forever, or at least for longer than you’re (I’m) willing to do without the item.”
And if I am buying cornflakes, motor oil, toothpaste, etc., I’m almost certainly doing that at a B&M store, not on Amazon.
I might eventually switch most of my routine retail purchases to them. But probably not for years if ever.
There are two different things that Amazon might do: pull the ‘buy box’ and pull the listing altogether. The latter is extremely rare - I’ve seen it happen for items where copyright was violated, for example. Usually if Amazon thinks there’s a reasonable chance that the item won’t be replenishable in the near future, they’ll just put up the out-of-stock message and pull the buy box (so you can’t backorder it.)
This is actually preferable, IMHO. I’ve gone back to look at the detail page for a laptop I’ve purchased - years after, when there was no chance it would ever be sold again - in order to reference its specs. It’s also nice to be able to go back and read reviews for out-of-print books, for example.
Pulling the buy box brings down its search rank, so generally it just ends up there for reference purposes. I’d be disappointed if Amazon moved to a model of actually pulling the listings of old items.