Why is write once run anywhere such a bad idea? Most high end applications are pretty declarative - "this is how the program behaves", and then you run it on a platform that someone else should worry about how it actually manages the state/how the computer does the actual computation with hardware.
Web seems like one answer to this. You can serve macOS, linux, windows, and then someone else worries about implementing the browser on those platforms. Seems like it has come true.
What about unity? You can pretty much just click a button and then you build versions for all the different platforms, there shouldn't be specific code in your unity project.
I feel there's plenty of other examples.