After upgrading to Windows 11 (offered through Windows Update, on PC not joined in the Windows Insider Program), it wasn't possible to open Windows Security under one of the user accounts and resetting it with command from the accepted answer didn't help.
By running this in PowerShell:
Get-AppxPackage -Name "Microsoft.SecHealthUI" -User $env:UserName
I found out that the Microsoft.SecHealthUI package wasn't registered for this user - it resulted in an empty output. After that I ran this command, but replacing $env:UserName with a user name for which the Windows Security wasn't broken.
The output included the package install location folder:
InstallLocation : C:\Program Files\WindowsApps\Microsoft.SecHealthUI_1000.22000.1.0_neutral__8wekyb3d8bbwe
Note that the exact name of this folder could change if its version number changes (perhaps after a new Windows 11 build is released).
Now it was possible to run this to repair the Windows Security for that user:
Add-AppxPackage -DisableDevelopmentMode -Register "C:\Program Files\WindowsApps\Microsoft.SecHealthUI_1000.22000.1.0_neutral__8wekyb3d8bbwe\AppXManifest.xml"