First, being new to u/w photography, I cannot recommend enough to get and read Martin Edge's book, The Underwater Photographer.
https://www.amazon.com/Underwater-Photographer-Fourth-MARTIN-EDGE/dp/0240521641/
The TG-5 and TG-6 will take very nice photos. The key to getting good photos with any camera is having adequate light. You can get great photos with a TG-5/6 and a good pair of strobes. Better than even the most expensive DSLR, if it doesn't have strobes and you're in anything less than shallow water with good ambient light.
The path I have taken is the same path I would recommend to anyone. Start with a camera and housing that are $1000 or less (together) - as long as the camera can produce RAW files and can trigger strobes. The TG-5/6 can do both. If you want to shoot wide angle, you'll also need to buy a wet wide angle dome lens to add on. Then, spend any additional money that you can afford (when you can) on really good strobes. If your budget demands it, buy one good strobe and save up for another later, rather than buy 2 cheap strobes to start.
The TG cameras are a good option. The Sony RX100, possibly an older model, like the Mk IV, in a SeaFrogs housing might be another good option. Or find a good used camera that has an inexpensive housing available. When I stepped up from a GoPro, I bought a nice m43 camera, used, for $400 (that was much more, new) and got a $250 Meikon housing for it, which has worked pretty much flawlessly for me for the last 4 years. I started with the inexpensive Meikon wet wide angle dome for it and got pictures I was pretty darn happy with. Eventually, I upgraded that dome to a Nauticam WWL-1 and have been very happy with the photos I've been getting with that.
I like incremental approaches that don't require junking expensive bits to upgrade them later.
Anyway, any of those will take great u/w photos, if you learn how to use them halfway decently. Get something like that and shoot it until you have found the limitations of what you're shooting, rather than your personal limitations. By that point, you'll probably have a pretty good idea of what to upgrade to, if you want, without having to ask anyone.
From the level of the TG or an RX100, the steps up (in order of increasing sensor size) are to m43 (Micro Four Thirds - which is mirrorless), crop sensor (APS-C, DSLR or mirrorless), or Full Frame (DSLR or mirrorless).
You can find an inexpensive (Meikon or SeaFrogs) housing for some m43 and APS-C cameras. If your budget for your first camera is higher, a Sony a6400 or a6600 (both are APS-C) and a SeaFrogs housing (around $280 - 350, I think) would be an option. The SeaFrogs housings for those have lens ports and support a variety of the different Sony lenses (i.e. for doing better macro or wide angle).
Once you step up past the Meikon/SeaFrogs housing level, you're now talking about real money just for the housing. At that point, to ME, it makes sense to spend your money on your long-term-keeper camera and the housing for that. And, to ME, that means Full Frame. Pretty much every time you get a new camera, you have to get a new housing for it. So, you don't want to be spending big bucks for a camera or a housing that is already borderline obsolete.
There are people getting great photos - I mean GREAT - on m43 and APS-C. But, for what it costs for the camera plus the housing that you need to get those level of photos, I would (did) choose to spend the extra money to have FF. A Full Frame sensor is always going to be better for wide angle and for low light (comparing same generation tech). If I were only interested in macro, then I might consider investing that much money in a m43 or APS-C setup - but that is not me. And I think too many other u/w photographers ONLY shoot macro.