I think this is just a picky optimization.
The first one runs the constructor to instantiate a new string, then gets its class (which is presumably a static property anyway). The second doesn’t have to run any constructor and just grabs the static class name from the type.
Maybe there’s more implementation nuance here but it seems like an opinionated rule that has zero effect on performance unless that code is being called thousands of times every second. And even then the compiler probably optimizes them to the same code anyway.
People like this are the reason AI is so unreliable at exploring code issues.
Like, I just want Copilot to look at my dependencies to explain a vague error I’m seeing and it’s telling me to downgrade Ruby, upgrade Rails, and install Python. Bro, it’s a node package.