Measuring voltage of a storage system with RPi
All the grounds can be connected together and to the negative terminal of the battery.

You don't say if the 48V is the actual maximum, so I'll assume it is nominal (calculated from each cells nominal 3.7V), and the actual maximum will be higher (13 cells would be closer to a maximum of 55V)

The voltage divider ratio is so high that the highest voltage at the mid-point is going to be less than a nominal 0.46V (0.55V maximum). That is wasting several digits of the ADC.

A better ratio would be around 20:1 (or even lower), which would give a maximum of 2.7V, and an extra two digits of resolution from the ADC.

You might protect the input of the ADC with a 3V zener diode in parallel with the 1k resistor. That way, if something goes a bit wrong, the ADC should be protected.

I apologise, but I still don't see the need for the opto-isolator. Please add some more information to your question to explain that.