The symptoms are very confusing, try disconnecting the speed sensor down by the front wheel and see if that makes any difference as that can be the only way the ecu is detecting the car is moving. Why that should effect the idle I don’t know.
"Vehicle Speed Sensor (VSS) and Speedometer A properly connected and calibrated vehicle speed input is important for proper engine operation as the ECM uses the vehicle speed input for idle control and engine history data. It is recommend a H-D(R) #74430-00A or equivalent vehicle speed sensor be used. This sensor is compatible with most after market speedometers. The speed input into the ECM can come directly from this sensor, in parallel to the speedometer, or from an output signal from the speedometer."