It kind of depends on the era. In the early years of TNG, while Roddenberry was still alive, the science was about as good as Trek science ever gets. Rick Sternbach and Mike Okuda were the main technical advisors and they made a good effort to keep the show grounded in real ideas. The astronomical phenomena depicted were often real, such as the periodic nova star in "Evolution," and even the more fanciful ideas were grounded in real concepts (for instance, the time warp in "Yesterday's Enterprise" was described as "a Kerr loop of superstring material;" that's an inaccurate use of "superstring," but otherwise the concept is grounded in real physics ideas, such as a Kerr ring singularity, something which does theoretically allow for time travel). For a while, the credited science advisor on the show was Naren Shankar, who's an actual physicist as well as a writer.
But once Roddenberry was gone, and once Bormanis took over as science advisor, the science began to get progressively more fanciful. Berman didn't care as much about good science as Roddenberry did, and just wanted a continuing stream of new gimmicks and technobabble, and Bormanis obliged him by coming up with an ever-lengthening stream of gibberish words (he seemed inordinately fond of fake words containing "-genic" and "-lytic," culminating in the catchall "isolytic," which was used for all sorts of things and has the nonsensical meaning of "equally dissolving"). Not that Bormanis wasn't trying; when he wrote the Voyager episode "Demon," he scripted it as dilithium that the ship was low on, but Berman & Braga changed it to deuterium, which was nonsensical on many, many levels (it's one of the most abundant substances in the universe, it would never be found in any quantity on a superhot non-Jovian planet, and it has no liquid form except at incredibly low temperatures), because they enjoyed the conceit of a starship "running out of gas." So I'm sure Bormanis knows his stuff and wasn't the root of the problem, but he did strike me as kind of an enabler, given all the technobabble word salad he churned out.
To your last point, I think something very interesting regarding 'consultants' can be read in A Vision of the Future
, regarding the script for Caretaker
. While describing the job of a script consultant, they showed a large number of notes that they had provided for the producers on script accuracy and content, some of which were fairly glaring/important (the name of Janeway's science ship translated to 'father's pissing'). And yet, tellingly I think, every single error they found remained in the aired episode.
Although the book made no point of this, I think it is quite a testament to how much consultants were actually listened to by that point.