That is absolutely a true thing you can say about the media and the election. They came to believe that Trump would not win the election, by being in a bubble where everyone they talked to had the same views as themselves.
But that is a totally different point than, and is actually logically incompatible with, the assertion that they privately believed that Trump _would_ win the election, but expressed otherwise to the public.