I encountered the same issue where the file would not respond when executed even after permissions were granted, and it could be run in the terminal. Later, I found out it was due to the file not being trusted. Please execute the following command to trust your file.
gio set file/path metadata::trusted true
I hope this solves your problem.