I confirm this. I also add up the following situations:
Anyone who connect to a realm can exploit this bug, since the host is not playing.
Enchanting or repairing consumes some levels sometimes, but not the same listed in the enchantment table or anvil.
Relogging will restore all your consumed levels back.
Leveling up will restore all your consumed levels back too.
Happened to me twice (once in two chunks, other in one) in 17 days playing in a PE/Win10 realm. Seems really random, since it seems it happened when no one was logged on, in random chunks.