I have one page hosted on one of my AEM server  and from another AEM server , I am getting this page in IFRAME. Issue is sometimes  gets loaded in  and sometimes not and shows CORS origin policy error. I am not getting this, if it is related to CORS Policy configuration, then why its not occurring always?
One thing which i noticed that When Page is loaded successfully, response header looks like this:
I guess that the difference comes from the fact, that the page might be cached or not. And some instance (probably AEM) does provide proper CORS headers, and if it's just delivered from dispatcher cache, these headers are not added properly. Can you validate my assumption?
If that's correct, you need to configure the dispatcher/webserver to add these headers.