The treasure hunting levels in SA2 feel like RNG.

I already highly dislike these levels but I learned the hard way the other day that the emerald pieces (keys in Egg Quarters and chaos emeralds in Security Hall) are randomized every time you play those stages.

Like my first play of Pumpkin Hill took me 20 minutes and unsurprisingly, I got an E rank. Then I decided to replay it but this time, I beat it in just a little over 3 minutes and got an A rank. A massive improvement but it felt a lot more luck than skill.