Reasonable people disagree as to the cause of the failure, but a replacement controller for the (new) Bafang motor I’m installing on my bike just arrived in the mail.
Disassembling the motor is straightforward, except for the part where you must excavate an internal plug from the silicone snot gluing it into place, eventually revealing its socket:

Regrettably, there seems no way to do that without destroying the dense closed-cell gasket around the connector:

Equally regrettable: a replacement gasket wasn’t included with the replacement controller. Although I don’t have any of the specific foam, some marginally less dense foam from the Big Box o’ Padding seemed suitable for laser cuttery:

The upper left prototype suggested a slightly larger rear bar that produced the gasket in front, which fit snugly:

It lacks the latch cutout, but the foam is squishy and I expect to never touch it again.
A generous glob of hot melt glue holds everything in place:

Although the usual Youtube videos show folks slathering RTV silicone caulk on these connectors, that’s a Very Bad Idea™, because RTV caulk releases acetic acid as it cures. That’s not a problem in the open-air siding-and-lumber environment the caulk was intended for, but sealing a glob of the stuff inside an enclosure will eventually corrode all of the electronics therein.
Cutting intricate doodads has become trivially easy: if you can draw it, you can pretty much cut it, just like that:

That was the easy part, anyway.
Do you happen to know, is there a silicone available from the big box which does not corrode things?
I think the pourable silicones intended for mold-making are the only common ones without acetic acid, but they’re not big-box store items and certainly not convenient for small-scale non-molded applications.
The stuff I used for the chocolate molds aged out after a year or so; I had to bounce it into the trash.
Judging by smell, but while GE’s Silicone I uses acetic acid, the Silicone II has a different, though also also a slightly obnoxious odor. Used a shoe polish that smelled like that several decades ago.
(Looks up Silicone II, trips over funky certification issues, finds MSDS pages.)
The MSDS infomation yields several polysyllabic compounds, none of which are acetic acid. Whether any of these can cause corrosion issues is best left to another student. [grin]