Client.shared.send(event: <event>) fails when adding stacktrace

I am using the Sentry framework in iOS to send Events. I can successfully send events and see them in the sentry web ui. However, when I add the stacktrace to the event that event never shows up. Here is the respective code:

var client: Client? {
    return Client.shared

func sendErrorEvent(message: String, parameters: [String: Any]) {
    client?.snapshotStacktrace { [weak self] in
        let event = Event(level: .error)
        event.message = message
        event.extra = parameters
        self?.client?.appendStacktrace(to: event)
        self?.client?.send(event: event,
                            completion: { error in
                                guard error == nil else {
                                    print("ERROR: Failed to send event, error is \(String(describing: error?.localizedDescription))")
                                print("INFO: Event \(event.message) successfully logged")

If the line:
self?.client?.appendStacktrace(to: event)
is commented out (i.e. don’t add the stacktrace to the Event) then all is working fine.

If that line is NOT commented out then the Event does not show show up (in the Sentry web ui).

In both cases the error is nil in the completion block of self?.client?.send(<…>).

Another unexpected behavior I noticed is that event.stacktrace is always nil (regardless of whether appendStackTrace is called or not).

Also of note, the server itself shows no errors, rate-limiting, or filtering for this project.