There’s a great Jacob Geller video about how methods of execution have evolved and why they’ve evolved.
I wouldn’t do it justice but it points out how every time we make a ‘more humane’ way of killing it often just reduces the person’s ability to show suffering, rather than reducing the suffering itself. In many cases the suffering is increased as we say the method is less barbaric; a firing squad has the highest success rate and likely the fastest death.