You are using the phrase “spirit of a person.”
Again that would be a human ghost, were it to exist.
I believe demons (not human spirits) are playing games on you, and/or you are being imprecise and unbiblical.
The soul or spirit exists separate from the physical body. It is what gives the physical body life after conception and it detaches from the physical body when a person dies.
Sometimes it gets stuck in this realm and becomes what we perceive as ghosts. Sometimes it is recruited by satan and becomes one of his minions.