In HDB3, does a 1 have opposite polarity to the last 1, or to the last V?
The diagram is correct. A 1 must have the opposite polarity of the previous pulse, regardless of whether that pulse was part of a 4-zero substitution or another 1.

Otherwise, it would constitute another V, which would be illegal.