Quick puzzle about utility functions under affine transformations

Here’s a puz­zle based on some­thing I used to be con­fused about:

It is known that util­ity func­tions are equiv­a­lent (i.e. pro­duce the same prefer­ences over ac­tions) up to a pos­i­tive af­fine trans­for­ma­tion: u’(x) = au(x) + b where a is pos­i­tive.

Sup­pose I have u(vanilla) = 3, u(choco­late) = 8. I pre­fer an ac­tion that yields a 50% chance of choco­late over an ac­tion that yields a 100% chance of vanilla, be­cause 0.5(8) > 1.0(3).

Un­der the pos­i­tive af­fine trans­for­ma­tion a = 1, b = 4; we get that u’(vanilla) = 7 and u’(choco­late) = 12. There­fore I now pre­fer the ac­tion that yields a 100% chance of vanilla, be­cause 1.0(7) > 0.5(12).

How to re­solve the con­tra­dic­tion?