Well keep in mind any time you are working with the arduino analog input pins that the default voltage reference is the board's Vcc/Avcc voltage. So if the board is being powered by your PC USB port then that value can be anywhere from 4.75 to 5.25 vdc and still be within USB specs. And if the board is being powered from the external power connector then the boards voltage will be determined by the actual output voltage of the on board +5vdc regulator which of course will rarely be exactly 5.000 vdc, but rather some value within the regulators tolerances. And if you change to another board it's on board regulator will have it's unique Vcc value. So how you decide to deal with all these various tolerances is up to you, and you can even just ignore them and live with the slight accuracy differences, but do try and understand the reason for possible small differences depending on power source and device variations.
So when you use a statement like this:
float voltage = sensorValue * (5.0 / 1023.0); //actually you should be using 1024.0 I believe
Understand you are making an assumption about that 5.0 value and the actual value can vary for the reasons stated above. And none of this is even addressing actual accuracy and variation in the sensor chip itself which is a whole other thing. In instrumentation quality measurements one usually does a setup for a final calibration that then makes any needed final 'offset' tweaks to the code to compensate for any error seen when the sensor is compared in real time to a independent 'reference sensor'.
Not sure what your Nano problem might be, but I would certainly check the wiring carefully again.