For what it's worth, there is the link below to opt out. I don't know if they honour this; I've previously read that they do but I'd be surprised if Palantir don't just do whatever they want.
https://www.nhs.uk/using-the-nhs/about-the-nhs/opt-out-of-sharing-your-health-records/