iOS/Safari throws "A request to switch to a different window could not be satisfied"

Hi,

I have recently hit a problem with one of my tests. When executing this test against Windows or Android this works fine, but targeting iOS/Safari fails.

I’m using Sauce Labs using the following capabilities and am coding in C#:

capabilities.SetCapability("appiumVersion", "1.5.3");
capabilities.SetCapability("platformVersion", "9.1");```

The test involves the following window-switching code:

```var currWin = driver.CurrentWindowHandle; // Get the current main window handle
...// Do some stuff which can include switching frames
driver.SwitchTo().Window(currWin);// Switch back to the main window```

When this runs against Windows or Android, it's fine. When it runs against iOS/Safari it throws the following error:

```POST window
1m 21.56s (+0.02s)
name: "4997.1"
=> A request to switch to a different window could not be satisfied because the window could not be found.```

Any help or workarounds appreciated!