In addition to drilling output I'd also make the argument that extensive reading (and sometimes listening) can help a lot as well for grammar points that are difficult to master. I found that reading a lot of articles and nonfiction especially really helped me with things such as conditional statements and some more advanced conjunctions (such as d'autant plus/moins que). What wasn't working with drilling was that some of these require much more context to understand than what is provided in a single sentence that would typically be in drills and reading sentences in context helped put it all together.
Another major class of persistent errors learners are bound to make: gender. And this is the kind of mistake that really jumps out to native speakers (mistakes like effect/affect in English are common among natives as well so they won't out you as a second language learner). I think here it really is a matter of drilling and noting down what we get wrong (since we can probably be proud of the fact that in the vast majority of cases we're right). Especially when speaking, I'll correct myself once my brain realizes what I just said was wrong, which means I know the gender I just don't have it automatically associated for speech yet. Any other input from someone who has worked to reduce this class of error is definitely appreciated
When I was taking flute lessons my teacher would have me take technical passages I was consistently making mistakes in and make me play them 10 times in a row without a single mistake before moving on to make sure I wasn't practicing the mistake. As she said, make sure that for every time you get something wrong you need to get it right about 10 times to change the habit. This is definitely the same idea behind drilling in languages. But another technique she had for technical passages that worked really well was to play them again but in a completely different style: different rhythms, articulations, playing the passages in a different order, etc. I think the reason it worked is that it put the focus exclusively on the notes and the fingerings themselves without having to worry about getting all the other elements correct. I'm wondering if there's an application of this technique to drilling grammar: maybe singing a sentence, for example?