Quoted By:
>Niantic confirmed to GO Hub the following: a Pokémon will earn PokéCoins based on how long it defends a Gym. Once its motivation meter is empty and it’s defeated in battle, it will return to its Trainer and come back with PokéCoins.
Well its good to be back