I found this:
https://www.researchgate.net/publica...ecommendations
Some of the references are quite old. Reading the titles I see some studies showed no benefit in those who were Mg replete. Looking at the various foods that have quite a lot of Mg in them I doubt anybody with a healthy diet would be deficient. We rarely checked Mg levels in hospital patients - when we did it was usually in those who had a low K level and were on diuretics.
Positive studies are of course more likely to be published - nobody wants to read a negative study.