Never use UnitAI::DoCast(uint32) method, it was not designed for this
Only use the overload that accepts a target - DoCast(target, spellId)