I’ve gone down the electrolyte rabbit hole here:
If I had to do it over again I would use sodium citrate (I use it now), and potassium would be the only other electrolyte I would consider adding. I don’t think there is good evidence that the remainder need to be replenished during exercise, even for extended periods of time. You need such small quantities of these, and have to buy so much that you end up with more than you will likely ever use.
Your magnesium numbers look odd - being higher than potassium seems strange.
My take on the electrolyte contents of many of the commercial offerings is that this is feature creep/checkbox based - meaning that they are selling really expensive salt/sugar, so adding these things makes it ‘better’. If their competitor has calcium, then they better have calcium too, as it is cheap, and they don’t want a ‘calcium gap’ to their competitor.
For Potassium there are some alternate salt-substitutes available that are pure KCL, rather than the half/half mix of Morton light salt.
For flavoring I have used true lemon/lime, and like those. I have tried some other ‘powdered fruit’, and found it terrible. Powdered gatorade is also reasonable for flavor. I have not used citric acid in anything so I can’t comment on if that is enough for flavor.
I would be very careful with caffeine powder - really just don’t do it. Getting math wrong could be quite dangerous, and measuring small amounts is hard.
I would also refrigerate this after making it. I usually pre-mix my gatorade+sugar mix and keep that in the fridge, and even there one bottle went ‘bad’ after it got neglected for a while.