After applying a slight modified version of the PR #8 i have timeout issue with Minecraft 1.19.4 but not with the version 22w18a.
Something to note is the version 22w18a is also slow to connect to the server. I'am not sure from where it come from yet, it could simply just be the patch from the PR in question but I'm skeptical about it so i prefer to open an issue instead.
EDIT: I can connect sometime and only if i close the client and restart it. And more rarely I can do that without restart the client...