I've got the exact same issue with my C238. I've replaced the usb port with a new one from the dealers, this didn't fix it. Then I booked it in for diagnostic with them and they said they couldn't find an issue so they deleted and re installed the software and updated it and charged me for it. A few days later I've still got the same problem.
Majority of the time it works. But when it doesn't, just like you I have to turn on the headlights manually and it works straight away.
Spoke to the dealership who are now saying they need to check for any wiring issues. However I don't think this is the issue after seeing others with the same issue.