Is this solution different from just executing this:
docker run -it --rm -e DISPLAY --net=host -v $XAUTHORITY:/root/.Xauthority -v /tmp/.X11-unix:/tmp/.X11-unix debian:12-slim
And then run the GUI app in the container? For example for Firefox: apt update
apt install firefox-esr
firefox
That is an approach I sometimes use to try GUI applications in a Docker container.