Running
/execute if data block ~ ~ ~ Items run say ChestHere
will correctly print ChestHere when standing on a chest. (And not, when you're not doing so.)
However
/execute unless data block ~ ~ ~ Items run say NoChestHere
will not say NoChestHere when not standing on a chest.
Confirmed, though this is probably intended. An error ("the target block is not a block entity") should prevent either condition from succeeding. This behavior is in accordance with
/execute if block
andunless block
both failing when run outside of the world, for example. However, probably the second command should at least print the error when run from chat?