If the player tries to use the /enchant command on an item and sets a level that is not applicable for that enchantment, they will be unable to use the command but the game will not give an error in the chat saying they cannot use the level.
Steps to Reproduce:
Give the player a netherite pickaxe
/give @p netherite_pickaxe
Run the command on the item
/enchant @p mending 2
Observed Results:
After the player runs the command, the chat will remain empty.
Expected Results:
The chat would properly log an error in the chat when the player cannot enchant their item.
Confirmed, and also this affects all commands, not just
/enchant
Try
/kill @e[type=blaze]
or/effect clear @s bad_luck
for other examples