Try printing the error value after the RD - that may give you a clue.

code:
RD "$lehman_mesdoc"
If @ERROR "Cannot remove directory: " @ERROR "/" @SERROR ? EndIf