Update: There is an issue filed on GitHub to fix this along with a workaround to use gsudo.EXE instead of just gsudo.
The workaround fixes the bash -c issue but not scripts using /usr/bin/env bash like this:
It works in the terminal as you can see below:
When I run it from one bash script it fails (I included a which gsudo to make sure it’s running the right one):
I tried to recreate the environment and it appears that if I call it with bash -c ... it fails like this:
With the --debug flag I get this additional window: