To reproduce, look at the command syntax help for /clear:
Type in
/clearHit the space bar
Hit
escYou will see the command syntax help for /clear:
/clear [<targets>] [<item>](see attached screenshot)
The provided syntax suggests that
/clear minecraft:enchanted_book{}is valid, which it isn't.
The correct syntax help for this example should be /clear [<targets> [<item>]].
It only suggests that if you believe that optionals can be left out no matter their position, which is not true. An optional is required if you want to specify more arguments after it.