You can buy empty land, build a great building, and still sell at a loss, even though you have generated wealth by the addition of work and expertise, maybe due to a market downturn for whatever reason, or maybe due to some factor specific to your property such as the announcement of a new airport flight path.
Speculative? In part, yes, even though you invested your money, time, and know-how. Otoh if you wanted to use the property some other way and that use is unaffected, you would retain the full value of your investment—or maybe more if valuations and therefore costs like prop tax fall.
When you buy a stock, it is the company that invests your money—you just hand it over with no certainty of either dividend or price change. They decide what to do with it, and how. You have purchased a bundle of rights, most often the right to sell, and the right to receive a dividend should one be declared.
The retail investor’s purchase of a stock is essentially totally speculative, with no control over business activities or use of the funds—unlike larger purchasers, who can buy enough to be activist.
Investment is when you imbue something with a bit of yourself. ROI is when you exercise control over that bit to your own benefit. Your intention at the outset to sell does not negate the investment that you have made. Even if you sell at a loss, the investment is the same. ROI is multi-faceted.
For the retail investor, the markets are always speculative, if gain is what you are after. You can rely on info from the past that you think informs the future well, but you never have any control over the use of your funds, or the perceived value of what they generate.
Otoh if you are after a gambling rush, then it is an entertainment expense with a particular value proposition. There are people like this, maybe more than you think.