Well, I have good news! I’ve been able to replicate your result!
And the problem is - I think your batteries are flat
I just tried powering the BitBot with our lab supply and slowly dropped the “battery” voltage down to see where it would fail. At 2.7v (instead of the ~4.8v of 3x fully charged AA’s) the micro:bit output a constant 1 on the screen.
There must be enough voltage to keep the micro:bit running (I checked, it’ll actually keep operating down below 1.8v), but not enough to drive the Ultrasonic sensor properly - hence the erroneous reading.
The good news is that the code definitely works!
Here’s a new BitBot XL running from a power supply replicating your issue:
And here’s the code running with fresh batteries.
Please let us know how you go with a fresh set of batteries!