Same thing happened to me, and I trawled a lot of StackOverflow queries that suggested cleaning and rebuilding would sort it, which it didn't.
Then I realised that there must be something about the blazor compiler only rebuilding when it thinks the original sources have changed.
So I opened /Layout/NavMenu.razor.css
and Layout/MainLayout.razor.css
, added a blank line and saved them. Then the publish worked - it must have checked the modified-dates on these files and decided that it didn't need to regenerate the scoped versions. Changing that modified time caused it to re-transpile them.
Note that you might have other transpiled CSS files (likely native Blazor ones, rather than your own components) that you may need to touch
to force than trans-compilation.