The short answer is yes. Any medication, given as a single dose, will recede in effect.
However, anesthesia practice has a strong safety emphasis and safeguards to prevent this situation from happening.
This is where maintenance of anesthesia occurs. Machines monitored by the anesthesiologist throughout surgery will provide the anesthetic medication while other measurements such as the blood pressure and heart rate, give indications of such events.
Well established and researched levels of anesthetic are maintained during surgery as well to reduce such occurrences.
In recent years, the BIS/ entropy monitor has facilitated the monitoring of depth of anesthesia by measuring brain activity. This is a sticker that is placed on the forehead.