As already pointed out in the comments:
There is an unstated assumption here that the Star Trek universe is different somehow than our universe
which AFAIK does not hold: there is no indication that the Star Trek universe at large is different from our own one.
Given that Gene Roddenberry in the introduction to his TNG writer/director's guide (aka The Bible) talks about "our galaxy" in realistic numbers, and that surrounding galaxies like Andromeda and Triangulum are common to both universes (Star Trek and our own), there is no reason to believe that the rest of the series universe is different. For what it may worth, Star Trek takes place neither in Middle Earth nor in The Matrix.
Arguably, the reason is that any such difference would be actually irrelevant for the series fictional world: for all its grandiose, Star Trek actually takes place in a relatively tiny vicinity around Earth, which does not even include the whole of our own Milky Way galaxy.
In TOS episode By Any Other Name, it is made explicit that even a trip to the nearby Andromeda galaxy is actually way off consideration, since it would take thousands of years for a Constellation-class starship of the era to make the trip, even if subsequent advances in technology would lower that time to only some hundreds of years at maximum warp.
Given this setting, it is only natural that any actual consideration of the whole universe's size or shape is actually absent from the show; even if we may be able to unearth some obscure slip-of-the-tongue relevant statement from some cosmic being like Q, admittedly one should not rush to take it at face value, in-universe or otherwise...