And then weeks debugging the phantom problems caused by the overuse of global variables that COBOL more or less mandates... I feel your pain, brother.
I’m sure for a lot of these companies, due to the sheer size and often mission-critical nature of these systems, the cost analysis still comes down on the side of keeping the COBOL/&c. systems and just using new tooling around them, like static analysers, integrations with frontend frameworks, ways to interoperate with relational databases, and software emulation of mainframes.
An alternative would be not only difficult to build but hard to sell. There’d probably be a lot of money in it if you had a team with the financial runway, technical skills, and market connections to do it, though.
I have written an RPG3 interpreter with all the Record Level Access operations working on a noDb/flatfile in C#, but lost the source after replacing a hard disk. I have also tried writing a RPG4+ (only free format) compiler for .NET, but it started getting tricky when starting to write the RLA operations because they relied on a database. I have the code still, but it's ugly so I never released it.
Would be a fun project, for sure. Not enough hours in the day.