A possible diagnosos/solution.
I came to this problem a few days ago when my previously trouble free Swytch (Brompton ECO kit purchased in March 2021) experience was nudged off course by it developing an intermittent, alarming grinding noise from the motor area.
I was assuming it was some sort of bearing failure until I came across this forum and was prompted to give the wiring of my set up a good investigation.
All seemed on good order until I discovered that the outer sheath on one of the two brake sensor connector cables (not connected on my bike) was split/worn, exposing the inner sheathing by 3-5mm where it entered the handlebar connector. I decided to effect a repair with insulating tape wrapped around the damaged area to see if it would fix the problem, and it seems to have worked with no recurrence of the problem after a couple of days of urban use around my home town which has a good mix of terrain, topography and varied road surfaces, including a good amount of cobbled streets.
I hope this helps, though time will tell…