Oat milk, like soy and other non-dairy milk, can separate and sometimes look "bad" or spoiled when added to a hot ingredient.
Assuming the "Sell by" or "Use by" dates have not passed, the key to stopping this could be to temper the milk as you add the hot substance. For instance, if you're using a Keurig, add the milk and any sweetener to your cup, then place the cup in the proper position and hit "BREW."
If you add hot water, tea, or coffee from a carafe directly into your cup, then first add the milk and any sweetener to the cup. Then slowly, and while stirring, pour a few tablespoons into the cup to bring the milk to temperature. Finally, pour in the remainder of the hot liquid, filling the cup.
Always shake the milk container before you begin to eliminate any natural product separation within the carton itself.