As mentioned above, this is an upgrade issue, so you need to create the book in a version before 1.21.6 because first, the issue is caused by upgrading to 1.21.6 or later, and second, after 1.21.6 Mojang removed the ability to format books.
In any chase there is now a attached world that showcases the issue. When upgrading, I noticed that also unsigned books that were created in 1.21.5 and then put in a lectern were affected when viewed in a lectern. After taking them out of the lectern and opening them, the formatting returned to normal, but only if they weren't signed before.
This behavior is different when compared to 1.21.10 and is highly unfit, and clearly not intended. Imagine trying to jump with a horse in the middle of a river then when reaching the end of the river the horse all of a sudden jumps without any user input and also without a jump animation. This is clearly on multiple levels not working as intended.
Can confirm in 1.21.11
Can confirm in 1.21.10
https://www.youtube.com/live/AEHc8jrcc6g?feature=shared&t=749
This is also especially sad because normally Mojang cares about long-term worlds so that nothing breaks, for example with terrain blending. But here something you create and looks great in a version now looks completely different and broken the next version.