Steps to reproduce/Testing done
1. Create a new site "test" on both remote and local server
2. Enable remote staging on local server for site "test"
3. Enable remote staging on local server for site "global"
1. Add portlet "Web Content Display" on a page of site "test"
2. Create a new content
3. Publish on remote server
4. Expected Result: The page and content get published
5. Actual Result: The page and content get published
1. Create a web content in "global" site
2. Add a "Web Content Display" on a page of site "test"
3. In the configuration, selects the newly created web content from "global" site
4. Publish on remote server (site "test")
5. It fails complaining about missing reference (which is normal)
6. Publish on remote server (site "global") from the control panel, site section. The web content gets published on production
7. Try again to publish "test" site
Expected Result: Publish succeeds and content is visible in portlet
Actual Result: Publish fails, still complaining that the reference is missing (even if the web content really exists in global site)
For all instances where the publish fails, the following exception is thrown:
Replicated the issue https://issues.liferay.com/browse/LPS-43604 for CE version