OK I've looked into the problem. I can't use version 5.0 since I'm using KryoNet which uses version 2.21, but it doesn't matter. Anyway, the value does get shifted to the left by 1 bit, which can be seen in the code of Output.java (both 2.21 and 5.0 versions). The code is within "writeVarInt" method:
public int writeVarInt (int value, boolean optimizePositive) throws KryoException {
if (!optimizePositive) value = (value << 1) ^ (value >> 31);
...
In other words, it seems to try to save the int sign in bit position 0, this is why it shifts everything to the left. Not sure if this code is correct though, I think it should use logical shift rather than arithmetic one (>>> instead of >>) if it wants to move the sign to the right.