The node can always lie by perfectly adhering to the protocol but doing something completely different behind the scenes. You can hash, sign or encrypt the code as much as you like but that has nothing to do with verifying that the hardware is actually running that code.
Maybe with homomorphic encryption this will be possible but AFAIK this technology is not even close to ready for such use cases.