Image recognition macro for Adobe Photoshop's "floating" palettes

I'm trying to create a macro in KM to click on a button in one of Photoshop's floating palettes.

Here's the palette (the Levels palette):

I want the macro to click on the "Auto" button.

I tried to get KM to recognize either of these...
Screen Shot 2021-11-23 at 1.03.53 PM

Screen Shot 2021-11-23 at 1.13.19 PM

...and I tried different combinations of "in the front window", "all screens", etc. but nothing seems to work.

Here's my macro:
Screen Shot 2021-11-23 at 4.19.34 PM

Is there something special about Photoshop that doesn't allow this to work? Or am I doing something wrong?

Hmm...after some experimenting, rebooting, and researching other posts, the problem seems to be related to Mac OS permissions. KM does have permissions for screen recording, etc., but sometimes that seems to go away. I was able to get it working after resetting security permissions, but then it stopped working after a while, and started working again after logging out and back in.