> I'd been assigned a medium complexity task
Who decided that it was medium? A manger? Some lead? You? You can't really compare what is easy and what is hard when it comes to software. I worked on a project that timelines started to slide when I came on board. Not because I didn't know what I was doing, I had just moved from one project to another. It was because the manager didn't account for the time it would take for me to learn the code base. He assumed that developers were cogs in a machine that can be replaced with no downtime. That doesn't work.
> I've realized I'm not a senior software engineer as I thought and now I don't know what to do next.
There are two pieces of advice I can give you here;
1. Nobody else knows what they're doing either. We're all making it up.
2. You're going to fail at something, a lot, before you get good at it. Go dunk a basketball and get back to me if you think you should just coach(manage) because you couldn't dunk
>A third option would be to take a break from work and try to learn to write good code
You're already at a place paying you to write code. Why take a break to do it for free?