Merge "Clean-up waitForToggleCommandComplete logic" into main