I'm having the same issue. the dialog pops up like every 10 secs. I reverted to 25.3.1 but then I got the bug in that version, which never occured. then i unistalled that version and now using 25.2.3. Seems stable right now.
Experienceing this on my 2019 Macbook Pro, Big Sur 11.6
as one of the first lines in your script and it should either be good for that one script or all scripts going forward, I'm not sure, but check it out.