OK, after a bunch of paper and pencil calculations I remembered that the game has a debug mode. :) I compared a couple of strategies for using the scrolls (various numbers of scrolls and different bonuses ignored or not), and I can see now how the maths works.
The lower early value of the scrolls is partially offset by the lower amount of XP needed to level at the early stages, which makes the penalty less noticeable in a typical game, but in extreme cases (all available scrolls spent before any levelling) the constant low value of the scrolls plus the additional HP gained and spent during levelling is not enough to match the increasing XP cost of levelling. That was the missing link for me.