With red going to vcc, black to ground and orange to pin A0. I have swapped this pot with a simple rotary pot with the exact same code and wiring and it works. I'm not sure how I can test if my sensor is faulty or what the issue here is.
The picture shows a connector, which you did not mention. Always post the exact device specification and a link the to the relevant data sheet.
To make sure that you have wired the device correctly, use your multimeter to measure the resistances between all the wires connected to it. Verify that the resistances change as expected, when you move the shaft.
Edit: after I posted this, you changed the picture. The connector may not be wired correctly.
When I attach one pin to positive and one to the Vout, I get no change in resistance. The multimeter is stuck at 1. I tested my cheap rotary pot(the one we often see for arduino projects) the same way and when I rotate the dial I get a resistance varying from 0 to 6. My multimeter was set to to 20K so I assume this means a varying resistance of 0kohm to 6kohm. This leads me to believe the linear pot is broken...