Just a shot in the dark here since you didn't say what your rig or the brand of camera system is. Some of the systems have a setting that only lets the rear camera work when you put the rig in reverse as a backup camera only. Maybe turning on the headlights puts it into "drive" mode and it only works in reverse. Again, just a wild guess on my part.
Dan & Ro with two Rescued Boston "Terrorists"
2015 Tiffin Allegro RED 38QRA
Previously '06 Itasca Sunrise 35A on a W22 Workhorse
'12 Jeep Wrangler Sport and/or '08 Honda Goldwing