It is, but there’s a big “but” with that. When the range is determined by agencies like the EPA, the car is allowed to run in the most optimal configuration, meaning:
No heating
No AC
No radio or other stuff running
No autopilot/self driving, which consumes a significant amount of power
They even put tape over the gaps in the body (e.g. around the doors) to lower air resistance
Minimal weight in the car. Only one person, no luggage, no extras that would add weight
Optimal weather (not too hot, not too cold)
This way they get an artificially inflated official range. Now when a customer buys the car, loads in all their stuff and people and actually uses heating/AC/onboard entertainment/autopilot/… and drives in suboptimal weather their range would instantly show as much less than the official rating. And this is where they were cheating, and would show a range number that was closer to the artificially inflated official one.
To be fair, though, when determining “official” fuel consumption for fuel burning cars, they do the same tricks as above. But they probably won’t cheat on the range display, since range is much less of a relevant value for fuel burning cars. Also, everyone expects fuel burning cars to burn much more fuel than it says in the ads.
(That said, when I got my new car, a Dacia Jogger, I was really surprised that the actual fuel consumption is actually lower than the official one.)