The item is not visible in the inventory, but it is there
Command:
item replace entity @p weapon.mainhand with minecraft:knowledge_book
Vanilla 100%
[media]
Attachments
Comments 4
Regression of MC-29318 it seems.
Resolving as a duplicate of MC-239935
Same can go for structure void, barriers, so on. It's most definitely intentional.