Something to add to this, with Terapagos, if you somehow manage to de-terastalize it, instead of the hp staying at the same percent or being removed completely, it will actually stay at the flat value.
I noticed this while using it in the Terapagos boss fight, as i would get the heal from transforming, and then immediately be forced back out of tera, keeping all of the health restored (i only made note of it due to finding it odd that i was healing between the phases)