it's not illegal, it's just not proper procedure because of safety reasons, someone might hit a parked car they can't see in the dark and then the city/county is at fault. I believe the officer can also be sued personally, happened to a friend of mine with pcso about 25 years ago where he caused an accident in a patrol car (his fault) and the department, the county, and he personally was sued.
__________________