AFAIK, Minecraft didn't support ipv6 before 1.18
But this isn't forge, it's java and your network configuration.
Instead of turning off ipv6 globally you can just set
in the java arguments of your launcher config (same place you specify the memory -Xmx value).
Forge/Minecraft has no way to know "connection timed out" is this problem - broken network routing
or some other issue. e.g. the server taking too long.