I wonder if it might not be the Circle of Magic series, by Tamora Pierce - yes, the same author Cupit mentions. The series has two kinds of magic, "wild" magic and "academic" magic, where the latter requires study and practice but is more reliable and repeatable, and the former is more powerful but also more difficult to control. the main characters, of course, have wild magic. This is a theme that pops up in her work several times.
There are several incidents where wild magic is grounded or needs to be grounded to be safe. There's an incident early on [book 1, Sandry's Book] where a character tries to take power from the tides (against advice) and grounds the energy in a boulder, the power is too much to be held and the boulder softens, then shatters, and the character gets smacked with the backlash. Another incident much later [book 8, Shatterglass] shows the same character having learned how to do so properly, winding power through her braids including lightning and winds), and another time they encounter another person whose magic got away from him when it wasn't grounded (via circle) it drew in leftover magics from the whole area, which warped his own untrained magic into creating a living glass dragon.
Another set of circumstances [book 3, Daja's book] has a character whose power gets away from them when upset, it grounds itself in some nearby metal rods to create living metal, and ends needing to give it roots to stabilize it. There's another incident where she created a weave of fire, and was called out by another mage (academic magic) that she wasn't going about things the right way, since pure fire and magic wasn't grounded correctly. There's another character at the same time who had linked several people's powers together to deal with an emergency, but who hadn't grounded the result properly so the powers were bleeding into each other and was causing further control problems, and the result rad to be reworked and grounded into a different artifact (a weave) to regain control. And the last episode, she has to deal with a forest fire and ends up gathering it together and holding it (to prevent it from reaching others) and has to root down and ground it in the earth so it doesn't get out of control and consume her.
And the third set of circumstances [book 5, The Circle Opens], there's an enemy mage who deals with, well, a third kind of magic - a magic of "nothingness" which is an unmaking, unwinding sort of thing. Obviously it breaks a great many rules of both kinds of magic already noted - for example difficult to find and track because it is a lack rather than a presence or eats up/contaminates other spells. This magic also winds out of control, affecting the personalities of the people working with the mage and later their bodies, as they become contaminated with the nothingness.
There's a bunch of other smaller incidents, I think, in the various books of the series - these are just the ones that I recalled when I thought about it.