As per Krieri's request, I am posting this separate from their answer. School of Wizardry, the first book in the "Circle of Magic" series by Debra Doyle and James D. Macdonald, does indeed match perfectly.
The protagonist, a boy named Randal, is training to become a knight when he sees a magician perform at his castle and has a prophetic dream which he interprets as meaning he's destined to be a wizard. He does have a great deal of trouble at school. He has a lot of power, but not much control. The candle lighting is a particular part of his test that he only barely passes because, instead of doing the "right" thing by invoking fire or drawing the heat form the candle, he's instead handling the raw energy. Master Laerg, one of the wizards at the school, does start tutoring him after that examination, and teaches him basic summoning, where he learns the name of the fire imp.
Master Laerg later attempts to sacrifice Randal to gain power from a demon and indeed, Randal summons the fire imp, who brings him the sword, and Randal uses his former training to impale the wizard. The wizards swear off use of all conventional weaponry, so indeed, he winds up on probation at the end of the first book, forced to seek out a reclusive wizard for his judgment and forbidden to use magic or weaponry to defend himself, a major issue because the kingdom is currently going through social chaos and bandits are everywhere.
You can find an excerpt on the author's website of the first chapter of the first six of the eight books in the series.