Well, multiple scientists and doctors during the French Revolution reported that multiple victims maintained consciousness, briefly, after being beheaded, up to 30 seconds. One such incident happened in 1905, to a French criminal named Henri Languille. The French used the guillotine as the State method for executions up until 1981. The last beheading was in 1977.
https://mikedashhistory.com/2011/01/25/some-experiments-with-severed-heads/
In short, it's not painless, and does not cause instant unconsciousness. If that was the goal, they'd render the "criminal" unconscious before execution.
But then, that's not the point, is it?
It would be called "Hail!"