My thoughts exactly.
If you slammed the door in their face maybe they ran off because thye thought you'd be angry at them.
Shoulda just said "I'm in here, who is it?".
Though I have heard of a doorknob being jiggled due to a ghost, it was a glass door and my uncle could see there was nothing on the other side, he
told it to stop and it did.