That suggests that the headlamp circuit is holding on the ignition relay. So I suspect the lights have been wired through it.
Years ago, a friend with a Land Rover Defender broke down in Chippenham. I was there. The RAC man attended and identified that the gear linkage had chafed the loom and disconnected the ignition feed. His fix, which he called a "temporary repair", was to scotchlock the sidelights into the ignition feed, so it worked with sidelights on.