The error message is typical of your antivirus program Realtime/Folder/Ransomware protection feature blocking the install, or if you are running Windows 11, Windows settings, Apps, Advanced Apps settings, Choose where to get apps option is set to Microsoft Store only.
Try temporarily disabling the AV feaure and check the setting above is set to Anywhere, but warn me before installing if the app is not from the Microsoft Store