Unable to fit display Picker wheel view inside non-fullscreen sheet on iOS17

This is a very specific issue, but I'm trying to display a Picker (wheel style) inside of a paged tab view which is itself inside of a sheet view.

Here's a example what it looks like on iOS 16 (working) and iOS 17 (broken): https://i.stack.imgur.com/Qe3S2.png

Notice how the sheet view is forced into full screen on iOS 17. The Picker seems to be the culprit because if I remove the Picker from the tab view, everything works fine. Here's a minimally reproducable example:

import Foundation
import SwiftUI


struct MainView: View {
    @State var showSheet: Bool = true
    
    var body: some View {
        Button(action: {showSheet.toggle()}) {
            Text("Toggle sheet")
        }
        
        .sheet(isPresented: $showSheet) {
            OverlayView()
                .presentationDragIndicator(.visible)
                .presentationDetents([.medium])
        }
    }
}

struct OverlayView: View {
    @State var selection: Int = 0
    
    var body: some View {
        TabView() {
            Group() {
                Text("Page one")
            }.tag(0)
            Group() {
                Picker("Picker", selection: $selection) {
                    ForEach(0 ..< 60, id: \.self) { val in
                        Text("\(val)")
                    }
                }.pickerStyle(.wheel).border(.red)
            }.tag(1)
            Group() {
                Text("Page three")
            }.tag(2)
        }
        .tabViewStyle(.page).indexViewStyle(.page(backgroundDisplayMode: .always))
    }
}

I've tried setting an explicit frame height on the picker, but am otherwise out of idea.

I also get this error:

UIKit Internal bug: Unbalanced call to _endOcclusion, please file a feedback report with any information you have that helps reproduce this bug!
Unable to fit display Picker wheel view inside non-fullscreen sheet on iOS17
 
 
Q