Crash when logging in using Kotlin

I’m experiencing the following crash when using app.login:

  at io.realm.internal.objectstore.OsApp.nativeLogin (Native Method)
  at io.realm.internal.objectstore.OsApp.access$100 (
  at io.realm.internal.objectstore.OsApp$1.execute (
  at (Unknown Source:10)
  at io.realm.internal.objectstore.OsApp.login (
  at io.realm.mongodb.App.login (
  at$signIn$2.invokeSuspend (
  at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (
  at (
  at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (
  at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (
  at kotlinx.coroutines.scheduling.CoroutineScheduler$ (

The MongoProxy.signin method looks like this:

private suspend fun signIn(credentials: Credentials):io.realm.mongodb.User?{

        return withContext(Dispatchers.IO){
            try {
                Log.d("SIGN IN", "Start Mongo sign in")
                return@withContext app.login(credentials)
            } catch (e: AppException) {
                Log.d(TAG, e.errorMessage ?: "UnknownError")
                return@withContext null

I’m a little confused as to why this wouldn’t catch any errors thrown by app.login, and then of course, why the error is thrown at all. I haven’t been able to replicate this, but this has happened over 300 times since I updated my app using Realm Sync last week. Any pointers would be very appreciated!