I agree with the first part completely, you can't hold a referendum in an active war zone.
The reason why they're doing so isn't about international law though, it's about internal Russian law which Putin is following to the letter in this conflict.
The recognition of the independant territories as such enabled him to order the SMO under Russian and as was argued at the time following UN law to give justification. Before that Russia had refused calls from Donbass to recognize their independence from Ukraine as to do so would have under Russian law forced Russia to have intervened.
The referendum again is about Russian law and what it allows under a SMO and once that referendum makes those areas Russian territory in Russias eyes, it will legally allow them to change the SMO into a war, and that changes everything in terms of allowable actions from the military. Up till now the Russian army has not been engaging according to it's military doctrines, and it's shown.
I fear this thing is gonna go up a huge notch in terms of destruction in the very best future