Maybe to a main dealer, I wouldn't do it to a private buyer.
I wouldn't do it full stop if it was something dangerous.
Mrs had a Vauxhall Mariva once (don't ask) was an absolute lemon, the electrics would intermittently completely fail, but yet the car would still run, off, anyway she traded that to a main dealer and never heard back.
But to be fair, she bought it from an authorized Vauxhall dealer that used to have a good reputation but they didn't want to know, they have subsequently closed down now.