5g/liter would be a shit ton... hope it's fine or a type-o.
5g/gal is ... 129 / 170 mg/s, respectively. x3.79 l/g =
489 ppm mg and 644ppm S. In a soiless/hydro context this is 6.5x too much Mg and S feeding through roots and you are suppose dto give much less in a foliar feed.
That is a veritable shit-ton for foliar feed. If oyu see problem in the coming days, probably the cause.
You should always fix nutrient issues by changing what you feed the plants through the roots. An extreme context may justify foliar sprays, but does not look like the case here. foliar feeding is a way to provide specific nutes to a specific locale, but relying on it is a very bad idea. just going to clog up stomata with minerals, which will reduce transpiration and co2 intake, which is a bigger priority. Plus, wet leaves indoors is a creating a needless disease vector.
small issues just take a bit more epsom salt in your normal fertilization and no risks. one tidbit about Mg... when you see symptoms it is 4-6 weeks after the deficiency began. So, in future you may need to add more Mg earlier on than you think. The deficiency started a month or more ago, and that's what you need to preempt - not when you saw the symptoms in the context of Mg.
I don't even clearly see any Mg-def symptoms in these pictures... interveinal chlorosis with coinciding spots...
foliar feeds should be a last ditch effort or for a very specific context and not a common occurence. It's more for people that need to 'feel' they are doing something or value doing things differently for the sake of being different without any reason to do so. i.e. akin to masturbation. Keep it simple. fix fertilizer formula and move on. Avoid the symptoms next time.