If the error goes away when you wait, you're probably not wrong about the cause. So following up on the idea of waiting, but waiting with purpose, this might be ever so slightly better:
for newdir in newdirs:
olddir = newdir.replace('h:\\','G:\\').replace('_academic','')
shutil.rmtree(newdir)
while os.path.exists(newdir): # check if it exists
pass
shutil.copytree(olddir,newdir)
Should some strange error occur preventing the directory from being removed but not raising an exception, the while
loop could theoretically go forever, but I find that highly unlikely.
I'm not proud of this solution at all, but barring new knowledge, this should be a little more fool-proof than an arbitrary delay.