Well, they may have rebuilt a library in Alexandria by the time the muslims got there, but it wasn’t “The Library of Alexandria”, containing the ancient books like those of Homer, since that was already destroyed centuries before.
You see part of the reason that the library was so big was that they had a scriptorium.
They did not have just one copy of their books but many. That way every time there was a fire they could refurnish the library. People in the town also had major libraries of works and any ship that came through was asked if they had any new books on board and copies where made of those books.
The Library's collection was dynamic, constantly growing and expanding.
So no, the ancient books were not destroyed centuries before they were still in the Library until the the Caliph of Baghdad decided to burn all of them with the exception of the books by Aristotle.