While designing custom UIButton (Scan button) with action captureTextFromCamera to captures live text, 1st time tapping the button shows the camera overlay at the bottom and clicking on the Insert button gets the input text needed.
While on the same screen, when tapping the same button to perform the captureTextFromCamera, the camera overlay is shown fullscreen and the close button is crippled with wifi and battery status.
let textFromCamera = UIAction.captureTextFromCamera(responder: context.coordinator, identifier: nil)
let button = UIButton(primaryAction: textFromCamera)
Same issue had been posted in Reddit, but seems to be an Apple issue without a solution.