The NHS surcharge predates Brexit and was over concerns of "medical tourism" by foreigners (ab)using the free NHS. If we assume this was a legitimate concern for the sake of the discussion, then there's a bunch of measures one can potentially take. Introducing an up-front surcharge is quite possibly the most idiotic measure you can take and just screams "fuck off foreigners we don't want you you fucking leech".
Why the hell should I pay £1,035 extra/year in addition to my taxes? Somehow your taxes are enough to pay for NHS but not mine? That just makes no sense. Having to pay five years up-front is just full-on idiocy on top of what was already idiotic.
Without a Brexit, all of this would still be the case for people from the Americas, Africa, Asia.