Quoted By:
"During our exploration of Area Zero's depths, I—Heath—strayed from the team and was later found unconscious. When awoken, I could only recall speaking with someone in an unfamiliar place, as if in a dream. I was found holding the page shown here. The handwriting is my own, but I have no memory of writing this."
This means that Terapagos brought Heath to the dreamlike place like it did at the Crystal Pool, and had Heath meet someone from the future to share the page from the Scarlet/Violet book with him. Thus leading to Heath writing the Scarlet/Book.