This sounds like a situation of mixed messages, and confusion coming from, and caused by, an elderly person.
Firstly, the old lady: When you approached her, she must have thought that you were ok, and was happly enough to let you detect...the fact that she limited you to the front yard indicates she was not totally comfortable with you being there. With some elderly people, it is not unusual to have second thoughts, and if she was living alone, then it's probable that she probably started feeling very vulnerable with a stranger in her front yard. Feeling vulnerable, it is not surprising that she did not approach you herself and ask you to leave, but called for help to do that.
The cop: Presuming he got a call over his radio about a man in an old lady's yard, detecting, he finds the place and there are two men there, not one. He has been given limited information of the situation, and most likely doesn't know that you initially had been given permission to detect there. If he's a reasonable sort of guy, then his first priority is to protect the owner of the premises, who is an old lady. Whether or not he had an ulterior motive in telling you to get out of town, I dont know. That seemed a bit heavy handed, particularly when he learned that she had initially given you permission to detect. Maybe he was just protecting his own (people).
It sounds as if you handled the situation well, and it must have been a disappointing way for your detecting to finish.