This issue has been repeatedly reported by users over the years, and the Microsoft team has closed it each time, saying they don't have enough information.
The big problem here is that VS2022 does not check that you have the version of Node / Angular CLI installed which it is expecting.
And when this issue happens, it just vomits a vague error about "Version of Angular CLI was not valid" without any details about which version it was expecting (and which version you actually have installed). It also doesn't give any clues about if it needs/demands a particular value of Node.
Given that VS2022 gives a template for letting users generate an Angular app from scratch, this is really poorly implemented. It's safest just to create the Angular app separately in VS Code and just use VS2022 for writing the WebApi service.
(It's currently April 2024, and I'm running the latest version of VS 2022 Professional v17.9.5, and have Node 18 and 20 installed, and Angular 14.)