It appears to count as both carried and held (either phrasing will trigger the message in the above example), even though the item is never in inventory.
It looks like the item is momentarily moved to the player’s inventory, when the action is invoked. This is handled by the ConvertToGoingWithPush() function (at the I6 level).
Instead of going while the player is carrying something that is not the thing gone with:
say "You can't walk while you're holding [the list of carried things that are not the thing gone with]."
Action variables can be a pain in the rear. It would be nice to define an adjective that means “carried but not because it’s being pushed,” but you can’t refer to an action variable in the definition, so I don’t think it’s possible.
Easiest workaround, I guess, would be to write an “instead of pushing the bookcase to” rule that doesn’t invoke going at all. (Just set the player and bookcase location manually.)