I had similar realizations and wrote this article about it:
...though you seem to assume throughout your article that humans would continue to exist and to be in control of human or above level AI which you point out would exceed our capabilities in every way.
Yours is not a failure of imagination, like the writers of Trek, but of sentimental anthrocentrism. A future with the technology depicted in Star Trek would be one dominated by intelligent, self-replicating machines made of programmable matter, spreading to everywhere within reach.
They would not construct starships, they would BE the starships. They would have no use of space stations as they don't need shelter from space to survive in space.
Their time and energy would instead go towards constructing matrioshka brains and similar computational megastructures around stars and black holes as primary fuel sources. Although "their" may not be apt as machine minds aren't discrete in the way human brains are. Think Borg, but no pointless biological parts.
Of course it's difficult to write a TV show about that which most humans would enjoy watching. It offends human sensibilities that we're not the final, perfected end product of evolution and that life will go on without us, much as it might offend a neandertal that they weren't the future either.