Grammatically I don’t think there is anything wrong with sentence. I think it is properly constructed passive voice sentence, and I have absolutely nothing against the passive voice in general. Choosing when to use the passive voice is sometimes simply about the clarity of your writing and is often just a stylistic issue.
With the sentence in your question, unless there is some compelling reason to phrase it in the passive voice, personally, I wouldn’t do it. “Some books were bought by Joe yesterday” is kind of an awkward and clunky construction, I think.
I don’t know the context of your sentence. Was it done as an exercise in constructing sentences in the passive voice, or is it part of an essay you wrote, or something like that? I’m not sure what the issue is. If it’s from an essay, or something that you’ve written, is there any compelling reason to use the passive voice and not to just simply say “Joe bought some books yesterday.” or “Yesterday, Joe bought some books.”? Stylistically, using the active voice here just seems less awkward to me.