A detective told the Natalie McGarry trial jury the former MP took refuge in a toilet as he read out a search warrant for her home.
Brian Butler stated McGarry was “angry and distressed” when he arrived at the scene on May 19 2016.
DC Butler said the the Fife-born former SNP politician closed the door on his face and did not conduct herself in a way “befitting of her position.”
McGarry, 40, from Clarkston, who represented Glasgow East at Westminster for the SNP, denies two charges of embezzlement.
Perth Foodbank money
DC Butler told jurors in evidence McGarry was distressed, angry and refused to remain still when he attempted to read the search warrant.
He said: “She then took refuge in the bathroom and I had to read the terms of the warrant through the bathroom door.”
The witness added: “For a person in an elected position, her conduct was not befitting her position.”
Prosecutor Alistair Mitchell asked: “Was there a point she came out?”
DC Butler replied: “Yes, she tried to slam the door in my face.”
The officer said that he was able to carry out a search of the property.
Items recovered included a cheque and cheque stub with charity Positive Prisons written on it.
He then read out a statement from a deceased co-ordinator of Perth and Kinross Foodbank, Les Paskin.
Mr Paskin told officers that he was in contact with an unknown member of Women For Independence about receiving a donation but had heard nothing back from them.
Money for charity
McGarry is accused of stealing more than £25,000 from two organisations advocating for Scottish independence between April 2013 and August 2015.
McGarry allegedly embezzled £21,000 while treasurer for Women for Independence between April 26, 2013 and November 30, 2015.
A second charge states McGarry took £4,661 between April 9, 2014 and August 10, 2015 when she was treasurer, secretary and convenor of Glasgow Regional Association of the SNP.
The charges say some of the money was supposed to be donated to Perth and Kinross Foodbank and Positive Prisons Positive Futures.
The trial has previously heard from the latter charity’s Peter White, who said the proceeds of a bucket collection did not arrive with his organisation.
The trial, before Sheriff Tom Hughes, continues.