As someone who loved Swing and used to hate JavaScript, that's really nonsense if you actually want to be a UI developer (and not just some side afterthought).
State management and the custom capabilities when you need them are amazing. I wasted a lot of my time writing tons of Swing code. Sorry, but the modern front end experience is much more enjoyable and productive. If you want "native widgets" I get the complaint, but most platforms seem to be less interested in consistent experiences these days.
JS devs just rediscovered MVC with some added immutability and that’s all. Hardly more productive. Also, I don’t see your point on custom capabilities - please add a slight modification to the date picker widget. Oh, you have to reimplement the whole thing with some insane number of divs, while you can trivially override certain parts of it in most desktop libs.
The biggest issue with Swing is just bad defaults. Except for NeWS, Sun wasn't really into the desktop business.
Although I haven't used it for more than a decade, I still have some fondness for Java. I like Workflowy but am not crazy about it being in the browser. I contemplated writing my own outliner and Java + Swing is one combination I'm thinking about.
This was pre WinUI, but a while back I worked at a shop that simultaneously maintained Web-based and WPF versions of an app. The Web version required 3 dedicated developers to maintain. The WPF version needed about half of one person's time, and had more features.
I would say that the main thing favoring tools like Electron is entry costs. There are lots and lots of people who know who to do front-end Web development, and you can do a good job of supporting all platforms using free tools. Even if you grant me for the sake of argument that native GUIs cost less in the long run, there aren't a whole lot of people who have experience doing them these days, even fewer who have experience on more than one platform. Going that route also requires you to shell out for Macs and probably also Visual Studio.
The other reason is that you care about resource usage. Web apps use more battery, bandwidth, and CPU.
Microsoft is trying to port some of this magic with Blazor, with is quite liked from what I read here and there.
XAML and MVVM is all about two-way data binding. JS frameworks copied it at first. But now it is widely recognized that 2-way data binding is a bad idea.
You can use for Web development too.