There's a difference between spells learned and spells prepared:
- Wizards can learn new spells either via scrolls or via level up (pick 2), while Clerics immediately get access to all spells of their class (as soon as they gain the ability to cast spells of that level)
- "Spells prepared", aka the selection of spells you are ready to cast, should only be able to be changed with a long rest (at camp). But BG3 lets you do it whenever you're out of combat - the tutorial text states that clearly in-game, and this is how it worked for me