Please don't question my curiosity.
Yes it does in Pokemon sword and shield
Source: had a Gengar in my box with 1 hp left and went to a Pokemon center and healed my party and it also healed my Gengar that was in the box
Edit: Heres another source that I got from Hellfire Taco https://gamefaqs.gamespot.com/boards/259372-pokemon-sword/78173345