I did a full reinstall (was gonna do it anyway to change my GTU), and I managed to reproduce this bug.
SoA +
ToB disc version, official patch 26498, TobEx v21. Nothing else (although I doubt one's mod setup has any consequence in relation to this bug).
Here's a screenshot. Nalia didn't even HAVE 3x cloudkill memorized (only one). Those cloudkills were placed in the contingency from the first "empty" slot.

I also found out what's causing it. This bug only happens when you're using the pre-memorized spells that come along with the NPCs when they join your party. You have to re-memorize their spellbook for the bug to go away, and then everything works normally afterwards.
For example, clear all level five spells that come pre-memorized with Nalia after she joins your party, then put in new ones (can be the same as the old ones) and level five spells work just as they should in trigger/contingency. Obviously, this bug affects all pre-memorized levels, not just level five.
Because of the way this bug works, it would be pretty rare for any player to run across it during their actual playthrough. Or just fix it, if it's somehow possible.
It stops happening if I disable this component.
Like DW already said, this is definitely related to "Contingency Detects Select Spell" component, as I'm unable to reproduce this bug with it being disabled, but with the rest of TobEx installed.
On ToBEx 21, with no other mods installed, I find that Nalia's and Imoen's Contingency/Trigger select screens don't show the spells in their spellbook. It's cosmetic (the spells are there, but not showing up). I don't have the same problem with Edwin, or with a sorcerer, mage, or thief -> mage PC.
It also affects Edwin, but you probably cleared & re-memorized his spellbook before casting trigger/contingency. Obviously this doesn't affect the PC.
Edited by The Cow King, 19 November 2011 - 08:09 AM.