A requirements file with --hash on every line installs cleanly on my laptop and fails with a hash mismatch in a fresh Linux container. Same file, same == pins, same index.
Let's separate what happened from what it means. Any --hash in the file switches pip into hash-checking mode, and then every requirement has to be pinned and hashed, dependencies included. So in the container pip settled on a file whose hash isn't in my list. I can see two ways that happens. The lock only recorded the files my laptop would install and the container wants a different wheel. Or a file on the index is no longer the file I hashed.
The first is a gap in my lock and the second is exactly what the check is for. From the outside they fail the same way, which is why I don't want to paste in whatever hash pip reports and move on.
What the hash pins, as I read it, is the version. How tightly it holds the bytes behind that version is the part I'm less sure of.