I see Mr. M gave you a good answer on English Forums. I completely agree with that answer.
You need another action, also in the past, to use the past perfect: He had died. I tried to get help for my goldfish, but as we pulled into the parking lot at the vet's office, I realized he had died.
Student or Learner