The bug seems to have fixed itself. I have renamed the world (both the in game name and the name of the save folder) and now the issues seems to be resolved.
I don't know if renaming the world was what fixed it or if it simply fixed itself. Maybe it's a problem with my computer, but it was really a strange bug. If it happens again, I will make sure to document the bug with a video showing it, but, for now, the bug it's not active anymore.
This bug affects every gamemode.
Problem solved: for whatever reason, a chunk was corrupted and the contraption glitched out, stopping the tp command from working.
If needed, I can provide a world download.
Each comparator is attached to a tp and a blockdata commands:
tp @a ~994 ~ ~1000
blockdata 1 89 -6 {Command:/}
I tested a little more: every mob is invicible, but if the player is in creative, he can kill them anyway.
So I think is a new feature, not a bug.
Sorry...
It affects also Endermites...
It become invisible, but still exist.
Try to spawn one with a different direction, it will fly in that direction. You can't see it, but when it collide with a block, you will see the explosion.
If you want to spawn it and be able to see where it is, you can try to stack a visible entitiy with it.
/summon WitherSkull ~ ~ ~ {direction:[0.0,0.0,0.0]}
In this way, the Skull is invisible and you can't interact with it.
It's a feature: if you hold a barrier block while in creative, you can see those particles.
After a closer inspection, I may have understood the bug. One of the command blocks that I replaced had inside the command /clear @a : what may have happen is that, somehow, this command was active and cleared my inventory without actually showing removing the items from my hotbar.
The command was part of a chain that used conditional command blocks, so this bug is probably related to those blocks and probably has been documented before in a different way. It's still a mystery how it happened and how it was fixed.