For one, the immediate economic profit does not reflect long term economic utility. There's factors such as availability, sovereignty, security etc. which are not reflected in hourly electricity prices.
Similarly, we don't look at immediate RoI of other key infrastructure investments: roads, hospitals, military. You sort of can of course, but the calculation isn't as simple as immediate economic benefit. You may finance some expensive preventative treatments which aren't strictly necessary (thus "loss making") but which prevent more expensive treatments down the line.
Finally, the environment is, effectively, gamified. Wholesale prices, retail prices, base load, storage... And it's all interacting with each other. A sceptical take would be that solar compete for a relatively fixed-sized pie of power generation (what they can displace from dispatchable power). But if battery storage doesn't become cheap enough, this will get saturated, and more solar will simply compete for the same finite demand, whereas a dispatchable or base load power plant, like nuclear, will continue to have marketable "goods". Maybe. Maybe not. But my point is, immediate RoI of solar tells you nothing about it.
You may of course arrive at the same conclusion with a better metric (I'm not sure) but that's a separate question. I'm saying the metric is flawed instead.