Imo, the problem you describe is a result of torque sensor not being at the motor axle. If you measure torque at the axle the controller can immediately modulate motor torque accordingly.
In this system, gear ratio is not known, that is the controller does not know which cog your derailleur is...