Try not to use paths, you’ll have some weird cross-interactions when two pieces of software set the same cookie (session cookies for example), which will make you reauthenticate for every path.
Subdomains are the way to go, especially with wildcard DNS entries and DNS-01 letsencrypt challenges.
I have had an identical problem a few years back, with a Samsung 2 in 1 that worked perfectly on AC, but had exact issues on battery.
It was the “power saving” capability of the GPU that triggered it on battery. So simply disabling this is the integrated Intel GPU control panel (in Windows) fixed the problem. Laptop is still running now and works with my sister in law.