If you are not officially graduated from a degree which is required for beginning a doctoral degree, you can ask your new graduate program if you can defer your start, explaining your situation.
In some cases, they will simply say no - some departments have a standing policy that they do not defer unless there is a medical emergency, and otherwise you are just welcomed to re-apply the following admission period (some departments do that only once a year, but some allow rolling admissions or once every semester).
On the other hand, in many cases they will allow you to defer and start the PhD at a later date. The main issue here is that some departments have strong policies in favor official cohorts - sets of students who enter all together in the same semester. Other departments have strong policies that you can only start a doctorate in a given semester each year, so you'd have to wait 1 full year to start (so if you planned to start fall of 2020, you'd have to wait until fall of 2021, etc.).
These should always be used as a last resort, because departments are generally free to change their policy and often decide on a case by case basis, and that sounds like an unpleasant amount of stress to volunteer to have to deal with (if you can avoid it). If you are still in the position that you have a choice of whether or not you need to be in this position, it is better to contact them in advance to see what kind of option you might have - or, if possible, just don't be in that position in the first place. If you only need one course, check with your University what option there may be to get credit for an equivalent course taken elsewhere, or take an online equivalent, or take a class in a summer/interim period (if your University has such a thing).
So you have a number of options, and be sure to investigate the most conventional ones (being able to graduate on time) while checking on the others as a fall-back plan, just in case.