I have figured out the answer:
Overriding the input handler is not enough, because the event bubbles through the SceneTree anyway.
I had to specifically call SetInputAsHandled() on the Scenetree.
In C# it looks like this:
if (@event is InputEventMouseButton eventMouseButton)
{
GetTree().SetInputAsHandled();
...