As the name implies, a deathbed will is a legal document drafted when you know that you will not recover from an injury or a disease. The medical professionals tell you that death is imminent and it's just a matter of time.
If you wait until this moment to draft a will, it can create a lot of problems for your heirs. The will may not actually hold up to a challenge in court. Even if it does, heirs may contest it and spend a lot of time and money sorting things out after you pass away.
One of the biggest potential issues with a deathbed will is that someone may claim you did not have the mental capacity to make the will. Perhaps your injuries or the disease robbed you of these abilities. Perhaps you were heavily medicated, calling into question all of the legal decisions you made. Perhaps the very idea of imminent death means you were dealing with stress, anxiety and depression, so you were not "of sound mind."
There are also potential problems if you don't have time to draft a written will and so you opt to use an oral will. It may hold up in court, but it may also open the door to challenges based on fraud, misrepresentation, undue influence and the like. Again, even when it works, it makes everything more complicated than it needs to be.
The best option is to draft a will in advance and get your estate plan ready long before you need it. Make sure you know what steps to take.