oops.se
The option gpio-shutdown is sending a "shutdown" signal to the OS. And your issue is probably related to the OS or more the desktop.
I use the gpio-shutdown solution to shut down Pi3, Pi4 and Pi5s and I dont have your issue as I uses the Light OS where I don't get the question.