That's normal. Your code will try to get the object and before that's ready sets the variable value. Since that affects the object, engine will abort the getObject request. The client should handle this and resend the command, so it will look Ok to the users.
To avoid this change the order of the calls and set the variable before you do the getObject.
Please mark as helpful and/or correct if you are helped by this.