If the operating system has no IP stack or networking of any kind then it's probably ok
Monetary profit isn't the goal. Even the GPL is too restrictive for Terry, so the entirety of TempleOS's source is public domain.
A non-profit organization can also sell things at a markup. There are alarmingly profitable for-profit tote bag businesses riding the back of non-profits everywhere.
As a profitable application, consider the worlds best gcode driver with extremely advanced lookahead and real time guarantees. Just pump gcode in a serial port and drive servos out a parallel port as fast and smoothly as possible. The problem with selling an app is you might have built an foundation for an interesting class of apps, but you'd need someone with domain specific experience to write the app.
I'm not a troll, but being old enough to have programmed on operating systems where a bad pointer reference could force you to reboot the machine (DOS, early versions of Windows, early versions of MacOS), I don't yearn for those days to come back. DOS was designed the way it was to allow it to run on cheap (for its time) hardware, not because anyone thought that it was a good development environment (Unix already existed at the time, so people knew how to write a robust operating system).
Also, is it a good idea to connect a machine that has an unprotected operating system to the internet?
Clearly this software reflects a lot of effort and ingenuity, but I doubt that people could be convinced to pay money for it.