Every time i connect to the modded server i made, It loads the terrain and everything then removes me with a message saying "Connection Lost: Internal Server Error" or rarely "internal exception java.io.ioexception an existing connection was forcibly clos
Make sure that the EXACT same mods installed on both your PC and the server. It is not enough to simply have the same mods installed, they must also be installed in the exact same Minecraft and mod version. Likewise, the version of the mod loader (Fabric/Forge) must be identical.
If you're 100% sure that they match exactly then you can try deleting your config folder on your pc and server.
If you use a Modpack make sure you're running the same version as the server.
Also, for the internal server error message, share the log after you get that error