I don't face this error using the <SetForegroundWin> only for the first window, but when I use the code with <SeForegroundWin> after each window target it does cause that error... Let me know if this works for you as worked for me 
*Resize for 1920x1080p monitor and five accounts
Code:
<Command ResizeAndPosition>
<TargetWin %2%>
<SetWinRect 1280 0 640 360>
<UpdateWin>
<TargetWin %3%>
<SetWinRect 1280 360 640 360>
<UpdateWin>
<TargetWin %4%>
<SetWinRect 1280 720 640 360>
<UpdateWin>
<TargetWin %5%>
<SetWinRect 640 720 640 360>
<UpdateWin>
<TargetWin %1%>
<SetWinRect 0 0 1280 720>
<SetForegroundWin>
<UpdateWin>
Connect With Us