So I've spent quite a few hours (6 hours to be exact) trying to figure this out. My girlfriend and I used to play on a modded 1.12.2 server with over 30 mods and we never really got a problem, server would start up normally, even faster than our 1.19 modded server.
For some reason which I suspect is the fact that since it's free the server doesn't provide enough RAM for the mods, whenever I add more than a certain amount of mods the server doesn't let me in showing me one of two errors which I'll submit pictures of.
I've been trying to figure out how to fix it cause it doesn't make any sense that on the 1.12.2 it lets me have over 30+ mods, a few being 100mb+, and on this 1.19 server I can have no more than 7 mods (counting relations) the heaviest being 23mb. If I do try to have more than 7 mods it just doesn't let me in the server. When I checked the logs it kept saying lost connection or "Can't keep up! Is the server overloading?" when I have more RAM on the 1.19 (2600) compared to the 1.12.2 (2200) and the 1.19 having way less mods.
So any help or is it just an overloading problem? Here are the logs: https://mclo.gs/nCabww1
(Forgot to add that when I only have 7 mods it lets me in normally and we can play, zero lag, zero disconnections, everything normal. But when we add more than 7, even a small 100kb one, it doesn't let us in.)