Not sure if you know exactly how much heat there is in the attic or not. It just so happens I've been monitoring my attic and crawlspace for the last couple months to determine which is the more appropriate storage location. My attic runs about 30 degrees warmer than the ambient but only on sunny days. Today it's cloudy and there's no temperature difference. There's also essentially no difference at night. I can't comment on whether pex running thru that space would pick up enough heat to be meaningful. I have heard that heat pumps generally have about a 30 degree delta, so that MAY be comparable but I couldn't tell you for sure.
Regardless of all that, as someone else already mentioned... putting 1000 ft of water filled pex in your attic seems like a potentially very dangerous thing regarding failure modes. If the pex develops a leak or breaks, its going to wreck, at the very least, your ceiling. The benefit of a roof setup vs attic setup is your roof is already designed to shed water. if something failed on the OUTSIDE of your roof, it wouldn't be great in that it would drain your pool, but it isn't also going to flood your house.
I wouldn't be shocked to hear that homeowners insurance isn't going to pay to fix anything from a pool heater attic induced flood.