When you change tire, or chain, ALWAYS take off the sensor, I want to say 5mm bolt and also the brake calipers, get them out of the way, do your tire work get it back in and back on, get the axle in and pretty much mounted on the bike THEN put the speed sensor back in. This little piece of plastic can be the first thing out, last thing in. This goes for BOTH of them, rear and front.
Make sure when you bolt it back on, it's flush like it should have been when you took it off, make sure it's clean, there is not any crap, road or otherwise in the hole you are sticking it in, and that the little slotted wheel, on the side of your wheel, (this is the speed sensor pickup) is clean. Any crap on there can cause issues. Over time, chain lube, road crap, stuff like that can possibly build up on this slotted wheel, AND on your speed sensor, or around where it pokes thru at. Make sure this is all clean. It uses magnetics, to put it simply, to work, if there is crud in there, it can severely affect it. This really goes for any bike, whether it's just an ON/Off or a Hall Sensor, or a fancier RF sig sensor. These can be pretty sensitive too, so if you beat the hell out of it, or grind it or rub it or nick it any way, it can damage it. In the case of RF types, it can change the resonant freq, which will screw everything up, in the case of hall's, you puncture the field, and it's game over. Be nice to your sensor.
Make sure your brakes are working, have full span AND are clean, the fluid is full and clean. Even though you may rarely use your rear brakes, the fluid can still absorb moisture over time, so be sure to check and change it anyways at service intervals. The dollar or two it may cost you for neww fluid is WELL worth the grief it can cause you if there are problems.
As for a sensor on the brake, I am pretty sue there is, it needs to see that you pressed the brake to turn the brake light on. ABS will work hand in hand with your brakes, so Im pretty sure it's looking elsewhere too. If your brakes are at the ragged edge of their operating stroke, then yes I can see that causing issues. BTW normal wear can cause problems over time too. As the brake pads wear down, the actuator gets closer to the wheel, that 'distance' is made up by fluid in the system, Ideally you will see that rubber 'seal' in your brake reservoir start to suck down into your brake fluid cup, letting you know hey, fluid is moving down, have you checked the condition of your pads lately?
Other than that, traction control, depending on your road, can get temperamental if the road is shitty. All those tiny slots you see on that counter, all it takes is ONE of them to slide by a bit late, and you can set off your TC. Think rough road surface, the grip is not quite there, you hit a small bump and the tire slop/slides a teeny bit. You may never even notice it, but your TC sure did!! It is not sentient, it can't tell if that is just the lousy road you are on, OR are you at the leading edge of a puddle, your tire is getting ready to hydroplane and it needs to kick in to save your butt from an impending slide and embarrassment in the middle of the intersection.
As a general rule, if you just did something to your bike, changed something, and you are seeing behavior that you did not see before and it's not a preferred behavior, then check everything.
Glad it's working for you though, it sucks when the TC or regen gets stupid on you. Especially if you like it hard and expect a good EB and then it's not there.
Aaron