Hi Gourav,
maybe it is a cliché, but there is an article for troubleshooting this particular scenario. The best way is to go over it an check all the suggetstions from there. There could be many reasons, strating from network communication problems (blocked
ports), name resolution issues, etc, etc... The evetns you see are pretty general, still please try to review the event details of each event and see if you find something speciic in regards to the cause.
Each SCOM GW can be viewed as normal agent.It does not even have an SDK. So, start here and if you are unable to find the case on the way, post again and include your findings so far.
Troubleshooting gray agent states in System Center Operations Manager
Hope this helps. Regards
Stoyan (Please take a moment to "Vote as Helpful" and/or "Mark as Answer" where applicable. This helps the community, keeps the forums tidy, and recognizes useful contributions. Thanks!)