While chemistry was being invented, anaesthesia was also invented, rather by accident – with great effect on art. Priestly was busy discovering oxygen at that time and the scientists of the day were unhindered by concerns about human subjects boards, lawsuits, or comprehension of what they were doing.
Davy’s experimental approach appears to have been to produce bags of various gasses, then he inhaled them to see what they did. Lucky for him, he didn’t manage to get a big lungful of nitrogen or cyanide.