liber -- book in general.
volumen -- one book from a series.
codex -- book, that is a collection of works.
Volumes is not the same.
Be careful when the words are not directly from Latin to English. Very often, it has more chance to have an altered meaning.
Volume is from Old French "volume" (from Latin volumen). In old French, meaning "scroll, book; work, volume; girth, size".
But the meaning did change one day in Old French, and it started to mean "book forming part of a set". For instance. "Britannica encyclopaedia, in 15 volumes".
It almost completely stopped to mean "a book/a rolled parchment, (except in some rare occasions)
(It also acquired the meaning in French of "massive quantity", and this meaning also was borrowed in English.)
This meaning, from the altered old French meaning (set of books, like a serie), is attested in English since 1520s, according to etymologyonline,
Meaning "book forming part of a set" is 1520s in English, from that sense in French. Generalized sense of "bulk, mass, quantity" (1620s) developed from that of "bulk or size of a book" (1520s), again following the sense evolution in the French word.
In English, the first meaning of "volume" (in the American Heritage Dictionary) is "book" ("a collection of written or printed sheets bound together; a book"). Yes, they add that it can mean "One of the books of a work printed and bound in more than one book."
In other words, "volume" is a possible translation of Latin volūmen, one of the basic words for what we call a "book".
There is not a whole lot of difference, necessarily.
Notice this sentence from Ulpian, recorded in the Roman laws codified under Justinian (in the 6th cen; but Ulpian is from the early 3rd cen. AD):
Librōrum appellātiōne continentur omnia volūmina, sīve in chartā, sīve in membrānā sint, sīve in quāvis aliā māteriā (dig. 32. 52, cited in OLD under liber, libri , m.)
"All volumes are included in the name of 'books,' whether they be on paper, or on parchment, or on any other material."
It's probably convenient to explain that liber, librī originally meant "the inner bark of a tree," which in the Old Roman period was used for making scrolls. By synecdoche, the material is used to mean the object and eventually becomes the primary meaning, even for books which are made of linen or parchment or papyrus.
I suppose if the motive were (mere) communication, that would be fine.
However, most people, when learning Latin, feel that they must tackle the fine points of the case system--for, if they don't, they'll never be able to read Latin texts (which is, presumably, the point of study).
Volūmina sunt in bibliothēcā is one way that we might write your (different) sentence. Notice the "library" is now in a prepositional phrase rather than being the subject of the verb; this will affect our choice of a number of words. (One interesting thing to note is that "books," expressed by the neuter plural noun volūmina , stays the same, whether it's the subject of sunt (as in your sentence), or the object of habet in the Duolingo sentence--that being a feature of neuter nouns (that their nominative and accusative forms are always identical).