It is best to have a dealer clear the codes, though I realize that is not always possible depending on your location.
Many OEM frame designs may necessitate removal of Drive Unit to allow access for replacing certain wires.. This may present some opportunities for additional damage to other parts, etc. Again, one of the reasons we recommend having the work performed by a Certified dealer.
There are several different lengths for the Bosch speed sensors, depending on frame design. On top of that, some of our OEM partners now use their own proprietary speed sensor solutions. It's gotten to be fairly complex as eBike frame designs have evolved in the past few years.
Not sure if this helps with your issue, but hopefully it's a little more insight at least.