How to identify the app behind: "Error: Unable to lock: Lock was blocked by an app"

As far as I know there is no other way to identify which X11 application is holding a grab. If you want to avoid this issue you could try using Wayland where the compositor is in control of grabs unlike X11 where it is the X11 server.