The issue was arising because in our worker role we continuously check the service bus queues to see if a message has arrived. And when we start both the local and cloud worker roles, then both the worker roles try to receive the new message from the same service bus queue. And hence sometimes the cloud one accepts it and sometimes the local one.
Using different service bus queue names for cloud and local projects resolved the issue.