Voltage Controlled Current Source - help needed
Your key issue is indeed the SPDT switch: the 5TS3A24159 has an Absolute Maximum rating of Vcc + 0.5 V on the signal path ports. You desire >12.5 V of compliance for your 5k ohm load at 2.5 mA. Fortunately for the magic smoke, your 1k sense resistor limits the current into the POS_end net of the analog switch to about 15 mA with no load, so the device was not obviously damaged. The leakage through the overvolted part is probably the source of your discrepancy. The lower load resistance on your 2.5k ohm testing probably brought the switch into a barely-functional operating region beyond the device ratings while at 5k load the node voltage was too high to function.

You might consider 1x ADG5436F or 2x ADG5419 to meet your requirement of 18 V single supply SPDT switching. However, these switches have a higher on resistance. You should have enough compliance at 18 V supply, though. Remember to check voltage compatibility at every node for every device.