I mean, let's start from the basics - if you have an agreed schedule of alternating and your co-worker doesn't do the task, then it's not entirely wrong to do what you did.
There were ways of handling it where your Co-Worker doesn't get in the metaphorical. And this is where your Co-Worker is probably annoyed.
In addition, if it was an Informal agreement between you two to alternate, rather than a formally agreed Business roster, then your response would further be viewed badly.
The difference being that if there is a Roster from the business and someone fails to do their part of the Roster - that is 100% on them. If a task is delegated to a team and it's not done then it's the Team's fault, not the individuals fault. You could have handled it better, doing the task, covering for your team mate in front of your boss and then privately asking what the reason was that it wasn't done.
They could have had a legitimate reason why they didn't do it, they maybe ought to have reached out to ask if you could cover, or perhaps they thought you would know that they had a reason why they couldn't do it and expected you to Cover.
I think the way forward to you is to reach out to your co-worker and say words to the effect of 'On reflection, I've realised that I could have handled that better' and hope your co-worker accepts your apology.