I ran into a similar problem. Calling stopRunning would freeze the app for 8 to 10 seconds.
I eventually tracked down the issue to this: I was calling stopRunning on a thread other than the main thread. This secondary thread was used for all transactions to the AVCaptureSession. The problem occurred because after dispatching the call to stopRunning, I blocked the main thread waiting for it to complete. Unfortunately, stopRunning posts something to the main thread and blocks waiting for that to complete. The thing stopRunning was waiting on eventually timed out and reported an error in the - (void)onRuntimeError:(NSNotification*)n callback:
Error Domain=AVFoundationErrorDomain Code=-11819 "Cannot Complete Action" UserInfo=0x19e43c90 {NSLocalizedRecoverySuggestion=Try again later., NSLocalizedDescription=Cannot Complete Action}
The solution in my case was to simply not block the main thread after calling stopRunning. Fortunately for me that was easy to do (and something Apple more or less recommends anyway).
I've noticed variations on this theme in other questions, and the solution has always been to rework the code. Hopefully this will provide a better understanding of why the problem is occurring.