If you interact with a cell door while your hand is holding a block:
Main hand holding block: The block is placed around the door, and this placement quickly gets canceled. Will not consume the block.
Off-hand holding block: The block is placed around the door.