You can lose money and that has to be reflected in the potential value of each envelope.
After the first selection, you must express the envelope value as the potential of what each envelope holds (the probabilities from the initial selection) which makes selecting again a wash.
Let A = 50 Envelope 1 is 100 Envelope 2 is 25
First selection 1/2(100) + 1/2(25) = 62.5
Great! Do it! 62.5 is bigger than 0, which is the expected value of not playing at all.
After that, it makes no difference to switch (the envelope value is recursive):
1/2(62.5) + 1/2(62.5) = 62.5
or
1/2(1/2(2A) + 1/2(A/2)) + 1/2(1/2(2A) + 1/2(A/2)) = 1/2(2A) + 1/2(A/2) = 5/4A
and the trick is that’s now the potential expected value you have (you now have 5/4A in your envelope), so switching is a wash. You never really “had” A as a value to compare against (by evaluating that 5/4A is bigger than A), we just get tripped up with the doubling and halving at the outset.
Said another way, the fact that 5/4A is bigger than A is irrelevant, no envelope contains A, they both contain the expected value of 5/4A.