I was able to resolve that. The problem was after login success, when IntuneMAMPolicyDelegate delegate method addIdentity was being invoked. And it is mandatory to call the completionHandler as below.
func addIdentity(_ identity: String, completionHandler: @escaping (IntuneMAMAddIdentityResult) -> Void) {
completionHandler(.success)
}