I've tried this feature in different save files, it never works consistently.
I've had the following issues in different save files:
-Pokemon had to follow me outside of Pokeball for it to heal.
-Pokemon had to be inside Pokeball for it to heal.
-Pokemon healed from Posion and then proceeded to heal HP. It stopped healing after a while.
-One fainted Pokemon took three in-game days of walking to recover. Meanwhile, other Pokemon in the same party did not restore any HP.
I haven't been able to make use of the feature as it seems to trigger at random under different conditions.