In Artemis Fowl, Julius Root along with other officers, enters Artemis's house to confirm that Artemis is dead after the siege and the bio-bomb. He immediately starts to throw up. It is seen in the later books, though, that he still has his magic. How could he have not lost his magic as he entered the dwelling without permission?
The Rule of Dwelling, i.e. the rule established by King Frond in The Book of the People which forbade fairies from entering human buildings without an invitation did not work on a permanent basis with a single infraction.
As per information from the later books: when the Magic laid by Frond was new and fresh, violation of the Rules laid down in the Book (including the Rule of Dwelling) would indeed result in instantaneous punishment in the form of the loss of Magic. However, by the time when the Artemis Fowl books take place, Frond's magic had become much weaker with time.
As such, breaking the Rule would have an immediate result of the fairy experiencing symptoms including nausea and vomiting. But the permanent loss of Magic only came with repeated violations of the Rule.
Mulch Diggums lost his Magic because being a burglar he repeatedly broke into human dwellings. Julius Root (and other LEP Officers in Fowl Manor with him) did not lose their Magic because it was a single (and presumably, their first) violation of the Rule.