Realm Function schema problem while updating records

iOS Class

open class MyXObject: Object {
     
    @objc dynamic public var _id: ObjectId = ObjectId.generate()
    @objc dynamic public var _partition: String = "...*"
    @objc public dynamic var _modifiedByDevice: DeviceObject? = DeviceObject()
    @objc public dynamic var _modifiedByUser: ObjectId? = nil
    @objc public dynamic var firstName: String? = nil
    @objc public dynamic var lastName: String? = nil
    @objc public dynamic var parentVetObjectId: ObjectId?

    public override static func primaryKey() -> String? { "_id" }

}

Schema JSON

{
    "collection": "MyXObject",
    "database": "Realm",
    "relationships": {},
    "schema": {
        "bsonType": "object",
        "properties": {
            "_id": {
                "bsonType": "objectId"
            },
            "_partition": {
                "bsonType": "string"
            },
            "_modifiedByDevice": {
                "bsonType": "object",
                "properties": {
                    [..Clipped..]
                },
                "required": [ "_id" ],
                "title": "DeviceObject"
            },
            "_modifiedByUser": {
                "bsonType": "objectId"
            },
            "firstName": {
                "bsonType": "string"
            },
            "lastName": {
                "bsonType": "string"
            },
            "parentVetObjectId": {
                "bsonType": "objectId"
            }
        },
        "required": [
            "_id",
            "_partition"
        ],
        "title": "MyXObject"
    }
}