The relevant principle of jurisdiction here is that a state has jurisdiction over the acts of its citizens. It's not uncommon and it's certainly not just a US thing (eg. here is a Brazilian court convicting one of its citizens over a murder committed in Australia: https://www.theguardian.com/world/2023/jun/23/cecilia-haddad... ).
The thing that's a bit scary about that Travel Act is: what happens when US laws change?
Instead of having sex with minors, suppose the US elected some crazy religious zealots who managed to make it illegal to have sex outside of heterosexual marriage, after getting abortion banned (so, not exactly far-fetched). So does that mean that all "US persons" (citizens, green card holders, residents, etc.) who travel (or live) outside the US and have sex with someone they're not married to are now criminals?
>So does that mean that all "US persons" (citizens, green card holders, residents, etc.) who travel (or live) outside the US and have sex with someone they're not married to are now criminals?
What might you say about war crimes? When was the last time we had a large scale war within the borders of the U.S.? Should the wars that have taken place since been free of such prosecution since they were overseas?