This is obviously not good!
Yes, the car behind should allow enough space, and is in the wrong here, but even so, sudden braking is not good and should be a voided.
So why sudden braking?
The obvious reason for sudden braking is when the driver finds circumstances changing unexpectedly. If they can predict what is happening well enough then they can slow sensibly rather than suddenly brake.
Under the current Highway Code, if a driver turning in to a side road sees a pedestrian on the pavement about to cross, the driver has to make a guess. They have to guess if the pedestrian will wait, or cross. Given the rules for pedestrians expect the pedestrian to look for cars turning, and the "Green Cross Code", etc, the driver may make the reasonable assumption that the pedestrian will wait. The driver proceeds on that assumption, not slowing much, expecting to make a moving turn in to the side road. However, if the pedestrian starts to cross, the driver has to brake suddenly because at that point they are required to give way to the pedestrian (§170 Highway code). This is unexpected and so causes "sudden braking".
As I say, sudden braking is not good.
Thankfully, as of Jan 29th 2022, the rules are changing. The new Highway Code rules say §170: "give way to pedestrians crossing or waiting to cross a road into which or from which you are turning".
This is a change, in that you now give way to those "waiting to cross". So now, when turning, if you see a pedestrian waiting to cross you not longer have to guess if they will wait or cross. You have to give way to them, to wait for them.
This means you can cleanly signal, slow, and wait for the pedestrian. No unexpected changes in circumstances. No sudden braking. Safer for everyone.
So yes, the Highway Code changes finally address this "sudden braking" issue, at last.