But it can. I mentioned Igalia and MediaInfo, and developed on this at https://news.ycombinator.com/item?id=38556450#38557836
I don't really know about games and good developer tooling, so I can't speak for these domains. Games are probably particularly tough. But I really think people may pay you for implementing features they need, buy support and for doing custom dev work. That last one takes your time out of your main product though, but if you manage to do custom work on top of your main product, it can still be a good deal.
With commercial desktop software at least there is the shadow of the law, thus some companies do survive despite piracy.
Hence why digital stores are so beloved by companies selling desktop like applications.
I bet there is hardly any company sustaining their business from sales on F-Droid.