How to train your replacement
"But usually nowhere does it say that they need to be trained competently, correctly or completely."
Exactly. Train your replacement to cookbook normal operations, load them down with the boilerplate documentation and the company standard practice manuals, the more the better. Carefully document what you give them or discuss with them. Go for volume, avoid content. Show your boss with how much you are doing to get your replacement to speed. But never, ever, mention any esoteric corner cases or hidden hacks, anything that lurks in the technical debt.
You have documented best efforts to train to avoid the inevitable train wreck, your redundancy pay is secure.