I don't see "attempting to pervert the course of justice" as having any qualified immunity to be dealt with. It seems to be a straight-up criminal charge similar to "obstructing justice" but at least one step higher on a scale of seriousness. Qualified immunity is a form of protection from being sued for violating someone's civil rights.
I'm not familiar enough with British/Scottish criminal procedure to comment on the specifics but they do deal with things quite differently over there. "Taking one's information" is considered fairly serious. However, it seems that something a bit more was expected when encountering someone actively breaking and entering. Past conversations with Brtish coppers informed me that they have just as much problem with "the thin blue line" as we do. But those conversations suggested that in many regards they have a lot more leeway in deciding how to handle situations than American cops gave.
In some ways I am wondering if the Sheriff was more upset about the comment that "We know you are trying to break in and if we didn't have another call to go to you would be getting the jail" than he was about not arresting the man. Telling crooks that they are low on your list of priorities does not seem a good way to keep them in fear of the police.