It’s not fixable with a couple lines of code. But it is fixable… You need to understand the game mechanics. Hero levels don’t mean a whole lot compared to gear upgrades. A single character level increase is about equivalent to a single gear upgrade, and some people do dozens and dozens of gear upgrades before they even care to level toons. So you can also have a crew of say all level 16 heroes decked out in insane gear that can easily slaughter level 18/19’s with regularity. You can also have a really rushed account with all level 20 toons with bad gear upgrades, that can’t even routinely beat decently armed parties of level 17’s. So they’ll lose and lose, and next thing you know that level 20 person is matched up against 15’s until they win 1 or 2.
So while I agree with your sentiment that PvP is still pretty broken, your “easy fix” with a couple of lines of code isn’t accurate. What Ludia needs to do (and they might already, i think i read it somewhere), is quantify the actual power of a team, with every single gear stat somehow translated to a number, and each account’s total power matched up to a range of equivalents. Again there may already be something like this, but those ranges expand when on losing streaks, and depending on your trophy count, max trophy count, and some other factors.
In other words I think you’re on the right track, but just looking at levels is useless and even worse it’s misleading (when you think you’re better than someone else just because you have higher character levels).