@Eskobar That implies that for Macs which are not displaying that prompt you have previously deployed a Configuration Profile with a PPPC profile granting access to System Events. Look at your Configuration Profiles for one with that PPPC profile and see why it's not being deployed to the Macs where that prompt is appearing
There's no need for a 'Tell' block when using the apple script command 'display dialog' so remove that.
Also osacript doesn't need to send a command to another process (system events) which causes the privacy prompt, remove that too.
Lastly running osascript in the user context is enough, unless you are doing more than just a dialog box you can remove adding them to admin group.
So it would look like;
sudo -u $user /usr/bin/osascript -e "display dialog....." etc.