I found out that in fact Inventorio mod is causing this issue. So I removed it and now this does not happen anymore.
My server crashes and spams the "[Server]Server thread/ERROR Can't find any space for item in the inventory" message before crash in console. After the crash when I start the server and log back in I am instant killed and my inventory is deleted.
I narrowed it down to what might cause this problem but I am not sure and don't want to delete the wrong thing. That is why I need to ask first.
I have the inventorio mod running which adds extra slots of inventory where the shield goes (instead of 1 shield slot I have 8)
And the crash happens exactly when I fill up my inventory full and try to shift click craft more by accident. This happened when I shift click crafted sticks out of wood and I was just shift clicking to auto craft until I got full inventory and crashed. I did this to have as much sticks in invenotry to trade with fletcher. I don't know if the game is trying to put those sticks in those extra slots added by mod and crashes.
I don't know if a mod that adds more inventory causes this crash or not.
I also run mods: Infinite Villager trading and Easy villagers, which add function to shift click buy in bulk not just 1 by 1, as well as no limit to it. I don't know if they play any role in this because last crash was caused when I crafted sticks not trading with villagers even tho 6-7 crashes before that happened when I shift clicked mass traded with villagers
I am running 1.16.5 Forge
Other mods that edit inventory I have are
Inventory Tweaks Renewed
Has to be something of inventory that causes this issue
Now I might be thinking it might be Inventory Tweaks mod or something like that. Even when the inventory is not full when I place 1 stick to craft and then shift click on recipe on a stick to craft max (64) the game crashes again for the same reason. And inventory was half empty