I shipped the motor to Bafang for troubleshooting. Here are some photos in case anyone can spot something wrong. The pinched speed sensor wire is bad, but wasn't causing any issue. And I see there is a nylon gear inside, but the gear doesn't look melted or anything. I wasn't able to get the cover off the other side of the motor, so no way to do a post-mortem on that wiring unfortunately.
View attachment 6View attachment 5
View attachment 6View attachment 5