Hey mama! Totally normal what you're experiencing, honestly, most of us go through exactly this around 5, 6 months. The constant bathroom trips plus hormones (especially progesterone, which really messes with your sleep cycle) mean you're gonna wake up more often, and yeah, sometimes you just can't fall back asleep no matter what. My neighbour was in the same boat at 21 weeks, and she eventually just accepted that broken sleep plus daytime naps was going to be her rhythm for the rest of pregnancy, and you know what, baby turned out perfectly fine.
The thing is, your body might actually be getting more rest than you think, even if it doesn't feel like it; some mums swear that napping during the day counts more than we realize when we're pregnant. That said, if you're consistently anxious about it or noticing you're exhausted beyond the normal pregnancy tired, it's worth mentioning to your OB just to rule out anything else, they might have tips specific to your situation.
For now, try not to stress too much about hitting exactly 8 hours; focus on whether you feel functional during the day. Rest when you can, and remember the discomfort and frequent peeing are totally par for the course.