So, the fact that your car started after touching the battery then it might be a potential electrical issue. And I think this is what made your settings go crazy. In this case, if the headlights were on the wrong setting, it’s likely related to a problem with the headlight switch, light module, light sensor, relay, or grounded wire.
In most cases, modern vehicles have automatic headlight shut-off features, but it happens on specific actions, such as the ignition switch being turned off, door opening or closing, parking the vehicle, or after a certain period of inactivity.
I can see these, but I cannot tell what caused the faulty headlight setting. You need to investigate more.