How do you detect if there is a connection from the Output Pin to the LED

Just now did that and made the Serial Monitor read out the value of the Analog pin but it now only gives back a value of 19 even if it is connected or not (also tried to completely disconnect the cable from the analog pin just to test but same thing)

Edit: Also tried a different pin (from A5 to A0) and now it just shows 14 for some reason