Speaking as a physician, and strictly in a technical sense*, I simply do not understand the problem that the states have in executing someone painlessly.
Every day thousands upon thousands of people have general anesthesia and are put to sleep quickly and without causing them any agitation, discomfort, etc.
I, myself, have had general anesthetics over a dozen times (a long story) and each time, upon awakening, I was struck with how sudden and decisive my loss of consciousness was.
Bottom line is that the executioners should simply follow a ‘typical’ recipe used by anaesthetists (but with a change in dose).
And, please note, by definition the drugs constituting the above recipes’ ingredients are widely available.
*i.e. I am not necessarily ‘for’ or ‘against’ capital punishment