As Darkzombie said, the “Stop following” command makes them stop following, and after a while they return to the last place where they were set to Guard. So if you want your thrall to stop following you and remain in place, you need to use the Guard command (ie. place them on the spot where you want them to remain) and not the Stop following command.

If you’re already doing this and your thrall still decides to randomly go home, I don’t know what could cause it.