Is it because I have a 2DS? Btw this is my first question in like 6 months.
I actually faced the same problem as you a few days ago.
Turn your 2DS before it levels up. It worked for me and my 3DS, so hopefully it works for you too.
you have to turn your 3ds upsidedown while leveling up
U have have to turn the 2DS/3DS upside down when reaching lvl 30 or higher.
Your timing turning your 3DS upside down is probably off.