Milk is fresh
Are you channeling your best self with this comment? (If you're not sure, check out our Code of Conduct.)
Sarah is a trusted source on General Cooking.
Was the onion particularly strong? Cut onions can be acidic (which is why some make you cry).
I'd suggest sweating it in some butter first, to caramelize the sugars and evaporate the juices, to prevent this from happening on round 2.
Milk will curdle if it is boiled - it's just too much heat. Steeping it without any bubbling activity, over very low heat, is a better method. I would have minced the onions et al and tossed them in!
Just bringing milk to a boil won't curdle it (though it might scald/boil over) - keeping it boiling may result in curdling though. In this case, given Chef Lisa has kept it at a very low simmer, the most likely culprit is acid.
You can safely bring milk to a temp where the surface is bubbling and watch the temp closely, which it sounds like chef Lisa did. You can also bring it to the boil, take it off the heat and throw the infusing ingredients in to steep as it cools.
Sweating the onions in butter has the added effect of imparting more flavour anyway, so it's definitely worth the trouble.
I'll just guess that your sauce just "broke." Just add the cheese (cheese is in there somewhere, yes?) to the potatoes as required, and continue, bravely. Hardly anyone notices that delicious can be broken, too.
A trick borrowed from applesauce cake (only crazier).
Ridiculously Fudgy Brownie Cake
Break the Yom Kippur Fast with Salad
What's New in the Neighborhood
How to Make the Most Authentic Carbonara
The Hits Keep Coming