Technically Yuzu was, allegedly, using something proprietary to run properly. I think the same is true of Ryujinx, although not sure. Now I'm not sure if it's true, given they settled out of court, and honestly we do know the REAL reason is the bottom line but legally they can't use that argument. Ironically I don't think it's even illegal to profit off an emulator, lol.
That said, emulators are legal in the same way a bong is legal while weed might not be. It's technically illegal to use roms/isos you yourself didn't rip, even if you have the cartridge or disk (and thus, license) of that game because it's not a copy of your cartridge or disk, but it'd be pretty annoying to prove you didn't rip it yourself as you'd probably need to go into the code to see if there's a unique identifier. I'm not sure if that's ever been tested in court, though I wouldn't want to try it.