I did some more checking and I remembered that the original version of the game had a similar bug. This time I rested in Spellhold dungeon first, immediately after the fight with Bodhi. The script worked as it should, and my main character went berserk and turned into the Slayer. If you don't get this to happen then you can't get the Slayer Change ability the next time you rest. I don't think it's the fault of any of the mods I had installed, unless they interfered with the script that's supposed to trigger after the first time you rest (where you go berserk). I still got the action error in the dream, but the Slayer Change ability showed up normally.
It could also have been a corrupted savegame, or it might have had to do with the fact that I had imported over my main character more than once.