Are you monitoring the CPU credits for this instance?
I moved back from EC2 to a VPS because I kept getting some occasional issues like this: my website got inaccessible and after some investigation it was always the CPU credits being used quicker than they were earned and reaching 0 credits, the lack of credits turns the instance into “baseline performance”, which is unusable (10% for a t2.micro).
It’s possible that when you switched to a bigger instance you started getting more CPU credits/hour and, with >0 credits, it was back to normal performance and “fixed” the issue.