It has happened to me with several pets. First one I used to see out of the corner of my eye, he would just be there, and as soon as I noticed - gone. This continued until I adopted another pet and then I never saw him again.
One that wasn't mine, different house a cat used to sleep under the washing thingy in the garden, I used to see him/her from the windows. Also would run in front of me in the kitchen, I would stop suddenly before realising it wasn't one of mine and it just vanished. One day a man came round who had lived in the house as a child, it seemed to have been his cat.
Next one, saw him walking past the door of the room I was in, clear as day. Also felt my bed move as if he had jumped up.
Next one, saw her at the food bowl, and later walking towards her bed.
Next one was very outdoorsy, he would be sitting in the garden looking at the house, in his old spot.
Next one was not mine. I had taken a stray to a sanctuary during lockdown and he had stayed there until I could get him back. One day I saw a cat in the hall that I didn't recognise. Followed by a message regarding the stray saying that someone (friend) had lost one of their cats and could they adopt him. The cat that had passed on was identical to the one I saw.
They do come back to see you.