Pex Pipe Freezing & Tankless Hot Water Heater Too
To prevent freezing of the PEX water lines in the attic I think you should consider covering them with a cover that would allow them to be kept warm from the space heating of the house. Insulation over this cover would prevent heat escaping into the attic. The cover would go all the way to the attic side of the ceiling and insulation would be removed from under the cover to that heat flow from inside the house can keep the pipes warm.

You report that putting foam tubing over the PEX lines did not work. The next thing to try would be electric heating tape, but covering the lines would seem to be a more permanent solution. I have never heard of covering of the water lines being done, but I have never heard of freezing of plumbing on the scale that is occurring in your house.