You have a bad ground. Lights can be dc or ac depending on the make, incandescent bulbs couldn't care less..but if by erratic mean that they go on and off then yeah bad connection.
On some bikes the taillight lighting coil actually energises the ignition coil for safety. So bad taillight bulb, no vroom vroom.