Even assuming it’s not malicious, the script can mess up your environment configuration.
You have to go out of your way to make something like that run in an fhs env. By that point, you've had enough time to think, even with ADHD.
For the most part, installing packaged software simply extracts an archive to the filesystem, and you can uninstall using the standard method (apt remove, uv tool remove, ...).
Scripts are way less standardized. In this case it's not an argument about security, but about convenience and not messing up your system.