Pasteurized milk boiling dilemma
The answer probably lies in your question:

refrigerated previously opened milk

Products that have been made shelf-stable by a heating process will be susceptible to spoilage again once the package is opened. While unopened UHT milk will last for months without refrigeration and ESL milk gets up to three weeks (depending on process and refrigerator temperature), once the package is opened, all of them will stay safe for a mere days only. The same is true for plant-based milks like soy milk.
So unless you have introduced some substance that encourages curdling (typically an acid), the curdling indicates that your milk has gone off and is no longer safe. Boiling will not remedy that.