I'm not sure, but perhaps you're starting the AI before you switch races?
I.E. the normal initialize trigger looks like this:
Melee - Set melee starting resources for all players
Melee - Create melee starting units for all players
Melee - Start the melee AI for all computer players
Melee - Set default melee options for all players
You'd want (assuming you haven't already) to make sure to change the race BEFORE the "Start melee AI" action. That's the only thing I can think of. Hope this helps!