Unable to switch to Iframe in iOS hybrid app

I could see many tickets related to this but all were closed. Hence creating this new ticket to get more clarification.

I am working on a Hybrid application.I am unable to switch to iframe in iphone realdevice/simulator. But able to switch to iframe and perform action inside iframe in Android realdevice/emulator.
With Iphone, when try to switch inside frame using appium (driver.switchTo().frame()), I am getting below error:

Error in Console:
An unknown server-side error occurred while processing the command. Original error: Blocked a frame with origin “http://localhost:8080” from accessing a cross-origin frame. Protocols, domains, and ports must match.

Could you please let me know, is it restriction from Appium or IOS?
Why is it working in Android without error but not in Iphone though CORS is enabled?
Is there any way/workaround to resolve this?

I have the same issue while switching to frame in iOS Safari. Is there any workaround?