I am getting the same error after installing Ubuntu 22.04.2 LTS yesterday, as my only OS, not in a VM, although I am nevertheless able to use Firefox. This is obviously an inherent problem with Ubuntu since I made no changes and the problem occurred immediately. I am also getting the same error regarding linux-headers-5.19.0-50-generic:amd64, but with no noticeable consequences. It's possible this is a result of my choosing the Minimal installation, and/or choosing to download updates during installation.
So you've done nothing wrong. There is something wrong with Ubuntu.
Sorry this isn't much of an answer; I don't have enough reputation to make a comment.
In full, Ubuntu tells me "An error occurred, please run Package Manager from the right-click menu or apt-get in a terminal to see what is wrong. The error message was: ' Unknown Error: '<class 'KeyError'>' ("The cache has no package named 'firefox:amd64'")'. This usually means that your installed packages have unmet dependencies".
There is no Package Manager in the right-click menu and I don't know how to make apt-get tell me what is wrong. Does anyone know?
Edit: running the Software Updater seems to have fixed it, but I don't know why this happened in the first place since I told Ubuntu to download updates during installation.