Earlier quoted context omitted.
In a way it seems like a classic trademark violation, tricking people (or their servers) into thinking your product is someone else’s. I wonder if there are actual agreements about this these days.
User agent strings aren't really seen by people so arguably there is no consumer confusion. And if you need the Mozilla user agent for compatibility it's reminiscent of https://en.wikipedia.org/wiki/Sega_v._Accolade
Statute doesn’t reference consumers, and does list deception as being prohibited. So it’s at least debatable.