Lookup what Tailscale is. Install it on the remote machine, then access that machine like a VPN would bypassing the router and the public aspect of the networking you're having issues with.
If instead you're saying that your ports are NOT actually opening because the service is problematic, then you have a diff problem. Debug and make sure the service you're expecting to be avai6is ACTUALLY available. Check that the process has the ports open, and check on that remote machine that it can actually connect to those ports.
If so, then just use Tailscale.