The Bug:
Using the enchanting table in creative mode deducts experience levels.
It's important to note that only the enchanting table exhibits this behavior; using an anvil in creative mode correctly leaves your experience level unchanged.
Steps to Reproduce:
Switch into creative mode and give yourself some experience levels by using the command provided below.
/experience set @s 10 levels
Place down an enchanting table and obtain any enchantable item.
Enchant the item using the enchanting table and then switch into survival mode.
Look at how many experience levels you have.
Take note as to whether or not using the enchanting table in creative mode deducts experience levels.
Observed Behavior:
Experience levels are deducted.
Expected Behavior:
Experience levels would not be deducted.
Linked issues
relates to 1
Comments 14

Still happens in 13w16a. (Windows XP, Java 7 Update 21) I had 521 levels, and lost 30 when enchanting a diamond sword in creative. This does not happen on anvils.
Also in 1.6.2. I just tested it.
Still present in 13w42b. Since your level isn't visible anymore in creative mode, a few more steps are required to observe. But I can confirm that it is present. I've updated the affected versions.
I'm surprised that even with the overhaul to enchantment tables in 14w02, they somehow overlooked this.

You can also notice this issue when you only have one XP level, go into creative and perform an enchant that costs more than that, it will still work but if you go back into survival all levels ar egone, eventhough it wasn't enough for the enchantment.
This ticket is currently blocked by MC-218626.
Can confirm in 1.18.2.
Can confirm in 1.19.
Can confirm in 1.19.2.
Confirmed.