The reason I have never done it is because of exactly what you describe. It’s way more difficult than it seems even if you discount the legality of it.
What I’ve done instead is what the other two folks have mentioned. I buy legit retro collections with arcade games in them. There are so many great arcade games in the Arcade Archives series now that you can find a ton of stuff that way, plus with something like the Switch and a monitor with a swivel base, you can play both horizontal and vertical games in their proper aspect ratios as well as portable.
The only way I’d go arcade cabinet now is with a Neo Geo Big Red or buying a Candy Cab from someone in the US and start collecting arcade boards/buy Neo Geo MVS games.
MAME is so convoluted now that you need a degree in retro to figure it all out, let alone come up with all the right ROMs.
This search should get you all the Arcade Archives releases…
While this one will give you all the ACA Neo Geo ones…
They do go on sale occasionally.
Don’t forget that Sega has their Sega Ages line which includes Space Harrier, OutRun, Shinobi, Virtua Racing, etc.
The Neo Geo Mini is also a great way to get some arcade in your life.
…that device also has this pack which goes on sale from time to time…
…finally, for Capcom, they have a sale right now on Switch that includes the Capcom Beat 'em Up Bundle and the Street Fighter 30th Anniversary Collection.