However, suppose x is placed in an envelope and handed to you. Then a fair coin is flipped. If it comes up heads, 2x is placed in another envelope and if it comes up tail, x/2 is placed in that envelope. Then you should switch.
It's a subtle difference in how the envelopes are prepared, but it makes all the difference.