Brain death presents differently than locked-in syndrome. It’s diagnosed by weaning a patient off drugs that could impair breathing and then seeing if the patient breathes on their own. If they don’t breathe on their own, the assumption is that the brainstem is no longer functioning and that’s what’s meant by “brain death.”
My grandfather had a stroke which affected his ability to breathe on his own. He was placed on life support for a little while. I was told he finally indicated he did not wish to remain on it (somehow, I wasn't there), and he was disconnected and allowed to pass. My point isn't that he was 'brain dead', but that higher order cognitive function can remain even after someone loses the ability to breathe on their own. I'd have no desire to cling to life in his condition, but I'd want to avoid any possibility of being around for the final harvesting operation.