This is formalized in the Kochen–Specker theorem [1].
Quantum mechanics is shown to incompatible with the following three assumptions being true simultaneously:
(1) locality, (2) non-contextually (independent of the context of the experiments (3) realism.
AFAIK, at least one assumption needs to go.
There is a nice paper by N. David Mermin illustrating the incompatibility [2].