Shift right clicking on an anvil with an open does not stop the player from opening the GUI
You still open the GUI when shift clicked with an open hand, but everything works fine with a block in your hand (it gets placed just fine). If you have a tool or any other thing in your hand, it works just as intended.