Laurens, have a look here at my post several months ago concerning speed sensor. Note that only one of the three wires from this sensor, yellow/pink, is used by the TSM and speedometer itself via the chassis loom distribution bombtail you refer to with different colour wires. From your explanation both these devices appear to be working correctly though. The other two are connected exclusively to the engine loom via its connector and are shared with other sensors so assume they form part of a network bus benefitting the ECU.
Some monitoring of the signals may be appropriate if it's possible whilst driving using Protune. Failing that just measuring signal voltages when idling normally and not and comparing with same on your other car.
Finally and a long shot, has the adaptive map got messed up and the ECU gone into limp mode, if there is such although would then expect MIL display. I remember some very similar symptoms with high and intermittent idle when the throttle stepper motor on a Mitsubishi partially seized.
ETA: as a temporary workaround and if car runs ok without speed sensor, you could disconnect just the yellow/white wire from the chassis distribution bombtail. This should leave the ECU without speed reference but TSM and speedo should still benefit from sensor.
Richard
2018 Roadster 3.7 1966 Land Rover S2a 88 2024 Royal Enfield Guerrilla 450 1945 Guzzi Airone