It depends on the book. A rare, specialty book is going to be more difficult to find than a more common book.
i collect rare books. in my experience there is two differing situations, a book is easy or a book is hard. books that are hard you find maybe one copy occasionally for sale. the price will vary wildly. it will be in another country and i have to order it through family members since there is embargo. or i have to pay 4x what it should worth. those is the hard books. for those books it is not realistic to expect it being found in the local book shop.
if the book you are talking about is a rare book, you should not make it a shitty RNG event. you should make it conversation option with book seller: "I am searching the rare book, can you help me find it?" and they use private contacts or mailing lists and a few weeks later you get a copy for a price.
the other book situation is the easy book. it is usually "somewhere". it is not unrealistic to expect the book in your local shop. maybe not every day, but unless it is a demanded book, why are you writing the extra logic to have copies coming into stock and being sold so very fast? just to punish player for fake "realism"?
this is extra work for tedious, bad design.
the only time random events makes sense is places player will go all the time. i walk through my front door every day, maybe someone is waiting at the door? I go to bed every night, maybe something happens on the way? this is okay design and adds a fun surprise effect.
the book store has no existence in player's routine. the player is not buying books every day. you are making the player do many extra clicks to arrive there and maybe or maybe not there is what the player wants. is this fun? is this a challenge? do you think walking through a door 20 times is a good game?