Core component of SQL Server for storing, processing, and securing data
The performance-counter is usually benign. The other is not.
Unfortunately, this is a difficult situation to recover from. First check, you have an x64 machine, haven't you? If you have an ARM machine, it's dead from the start. SQL Server does not run on ARM. (Well, you have success with LocalDB.)
Else, my assumption is that these type of errors are due to previously failed installations followed by some random cleanup which messed up things more. Some people have reported success after having followed this article: https://www.sql-easy.com/learn/how-to-uninstall-sql-server/ But there also who have tried it, and who came no further.
You also read this article: https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/database-file-operations/troubleshoot-os-4kb-disk-sector-size. It discusses a known issue where Windows 11 reports a disk-sector size that SQL Server cannot handle. This is not what causing the failure with the MOF compiler, but it could be the reason for the original failure.
If that does not work out, your best bet may be to create a virtual machine and run SQL Server from the VM.