I assume you use a script or some automated process for these steps. Can you add some waiting time between these calls and try again (e.g., add a delay after the update call)? There are multiple registry transactions happening in the background that could have resulted in a missing definition in the registry, which is the reason you were unable to retrieve the OAS definition.