The bug
Of course you cannot place blocks when aiming at a block that is outside the worldborder, however you cannot even use any items at all when aiming at a block that is outside the world border. Relates to MC-11211.
Here is a list of affected items (may be incomplete):
Food
Potions
Bow
Trident
Crossbow
Shield
Snowball, Egg, Ender pearl
Armor (equipping by right clicking)
Eyes if ender
Experience bottles
Empty maps
Book and quill
Written books
Additionally you also cannot use any items that spawn entitey, like spawn eggs, armor stands, fire works rockets and item frames, but that is likely intended, because you cannot place blocks outside the world border.
How to reproduce:
Go to the worldborder by teleporting or reducing the worldborder using a command
Target a block outside the world border
Try to use any of the listed items
❌ You can’t.
As soon as you look away from the block you will be able to use it.
Does MC-212621 describe this issue?