I wouldn’t say soil quality doesn’t matter; quite the opposite. I’d even say your sandy compost happened to provide the perfect soil for that tomato plant.
Try it with some usual compost which really stinks, so badly you can hardly stand it. It won’t make ideal soil for most plants. The plant probably won’t thrive, then.
They always do better where they choose to grow
This happened to me this summer, but with pumpkins. A random pumpkin seed from the compost sprouted into a monster plant that took over half my yard. I never once watered it or anything. None of the things I actually planted in my garden amounted to anything, but I managed to get a few decent pumpkins from this random plant that popped up on its own.
I have the same thing going on in my potato patch. 3 random plants popped up, one of them a monster. They all seem to be of the pumkin/squash/cucumber family but I can’t tell because they haven’t grown fruit yet. Guess I’m in for a surprise veggie reveal!
Same thing happens to people


