So, it could be an issue involving your shoes/pedals, and it might be a problem of technique.
I’m going to wager it’s both, but that technique could mostly sort it out! I have a full suspension trail bike and pedals with long pins, but I have ridden a friend’s hardtail plus bike with very low pins on his pedals on rooty trails with out much issue, so throwing on a rear suspension isn’t an end-all solution.
One question: when you are bouncing off your pedals, are you standing, or still sitting in your saddle? If you constantly have your weight in the saddle on rough sections, your feet are going to bounce off. You have to very consciously apply your weight to flat pedals to keep them on, and let bumps pres them into your feet, then absorbing the bumps with your legs. If you are staying on the saddle in rough parts, it’s likely that you aren’t weighting the pedals enough, and that’s why you get bounced off.
Now, sometimes you will hit rough spots while in the saddle, such as technical climbs. Same idea here, you just have to constantly make sure you keep the pedals weighted. With flats, you should always be applying a little downward pressure to your pedals to keep them weighted so you don’t bounce off. Even on the upstroke, you can keep a little downward pressure (or even point your toes a bit and put pressure backwards onto the pedal) to keep your feet in contact.
It can be hard to get used to, but practice enough and it will become second nature. I switched to flats in January after only riding clipless pedals before, and I love them. I’m not racing, so I really don’t care about the small loss in speed from not being able to pedal through rough stuff, and it’s so much nicer to have regular shoes for hike-a-bike sections. They have really helped me become a much better rider, and I have avoided some crashes where I definitely would have washed out in clipless pedals. Definitely recommend sticking with flats.