For example if I where to try and repair my enchanted diamond sword that only required 70 levels of xp in creative mode I could enchant it because in creative mode you have unlimited xp but if I tried to do it in survival mode and have more than need to fix it it would say to expensive even though I have 103 level and you would need 70 levels to fix it.
This is working as intended. Read on here: http://www.minecraftwiki.net/wiki/Anvil