I have felt something similar when a mutual friend passed. I knew she was dieing (Liver Cancer) and believed she came to me to say goodbye. My BF at the time was with her. Messaged me that she just passed.
Lise was and had always been close with her brother. Her wish was to die at home. They had a few days to redecorate her bedroom and paint it in colors she loved.
I was in my bedroom and something had me look at the window. She was there smiling and waving her hand. Then disappeared. A few minutes later I had the call she passed in her sleep. Felt no pain.