As someone who once worked on desktop apps professionally, I've been asking myself this same question a lot over the last couple years. I think there are a few reasons.
- Mobile completely eclipses desktop in active userbase. With the pandemic, desktop has made gains, because people have been stuck at home, but nobody expects that to last forever, and even with the gains, mobile is far more popular. Compound this with the fact that, for years, mobile experiences have been held back because developers were on desktop, even when most of their customers were not. It's difficult or impossible to develop on mobile, and a pain to test on a separate device, so most developers worked and tested on desktop, leading to things being too small or non-functional on mobile. This gave rise to the mobile-first push, mostly from managers and developers who understood the market importance of mobile. In many organizations, I suspect it was such a slog to get everyone on board, I doubt they want to risk undoing that effort by creating new desktop apps.
- Desktop frameworks have not just stagnated, they've degraded. This is most true on macOS, least true on Windows. Even as Apple has invested in updating AppKit, the results have been uneven. There are still some controls using cells, and some controls that were updated to use views, but then haven't been updated to match newer framework conventions. At the same time, new bugs get introduced in every major OS, making desktop apps buggier over time, and forcing app developers to constantly keep on top of things.
Apple has tried to hit this from multiple angles, from running iOS apps on Mac, to SwiftUI, but I think it's telling that SwiftUI works best on Watch, then on iOS, and finally on Mac. The desktop is the lowest priority for that framework. Catalyst and running iOS apps are largely throwing in the towel, replacing desktop development with mobile development, but even then, they're not perfect.
Linux has faced less-extreme versions of these issues with both GTK and QT, though at least these aren't strictly tied to OS version. There's also issues around licensing drama with QT, and the fact that selling software on Linux is a very difficult sell.
On Windows, Win32 and Winforms remain relatively stable, if somewhat unpleasant to work with. WPF and WinUI seem to always have some issues, not to mention WinUI is limited in what it can do, which is why Microsoft eventually opened their app store up to Win32 applications. But it's not always clear which framework you should be using for a new project.
There are, as you pointed out, always cross-platform frameworks like react native, but not to disparage those who are developing those frameworks, they just don't match up to true native frameworks once you get past very simple apps. There are issues with cross-platform design, of course, but also with performance. These issues can be overcome in cross-platform apps (see VS Code, Discord), but I don't think I've seen a cross-platform app that was "good enough" except for electron apps.
- The desktop is in a weird place, design and quality wise. Traditionally, the table stakes have been higher for desktop apps. You needed to have more features and more polish. You needed to be compatible with other desktop software and more hardware peripherals. There's also always been the fact that OS paradigms have traditionally been different. If you ship a cross-platform app that did things the Windows way, Mac users would complain, and vice-versa.
But that's becoming less important as more people migrate OSs more often, and platform conventions are becoming both less important and more homogenized, especially as users who grew up on mobile start using desktops for the first time. That's part of the reason VS Code can get away with so many Windows-style keyboard shortcuts on the Mac.
However, it's still an issue. Just look at the 1Password beta forums right now to see how many contradictory changes are being requested now that 1Password shares a UI design between desktop platforms.
- Important Web apps have gotten to a place where they're good enough. See: Figma vs. Sketch. Performance and polish-wise, Sketch beats Figma hands down, but Figma is good enough, and it makes collaboration much easier than Sketch. It's cross-platform, and since it's a Web app, it's easier to get your collaborators to use it, since all they have to do is click a link you send them.
There's a similar scenario with Google Docs. Native versions of Office are still technically superior, and Office 365 exists, but most college students and younger are using Google Docs. It's free, it works well enough, and it's easy to collaborate. If you try to write an entire book in it, you're quickly going to get bogged down with performance problems. Seriously, word processors from the 1990s outperform Google Docs once you get beyond a few hundred pages, but few people push it that hard. It's not uncommon to see college students with top-of-the-line Macbook Pros that have exactly third-party apps or personal files on the device. They're nothing but Google Docs and social media terminals.
Desktop conventions and integrations are still important to a large but slowly shrinking subset of users, but foreign to a large but growing subset of users. It's tough to know exactly how to design a desktop app to appeal to a large enough audience.
- The market. Desktop app stores have tried to push desktop software along the same pricing trajectory as mobile, but have only succeeded in splitting the market. There are lots of Mac users who won't download any software outside the App Store, but the App Store on the desktop sucks. The sandboxing requirements make a lot of software impossible, the pricing is in a downward spiral, as on Mobile, but unlike Mobile, few people actually browse the app store, so it doesn't lead to any discoverability. The story on Windows is similar but less extreme. Microsoft has opened their app store up so basically any app can be on there, but there's not really an incentive to put apps there, and people don't browse it.
There's no good places people go to browse for desktop software anymore, perhaps because of a lack of interest, and that can make deciding where to sell your software and how to promote it a difficult decision.