Found the solution: UIView has a new cornerRadius property in iOS 26 that you can use instead of layer:
glassView.cornerConfiguration = .uniformTopRadius(20)
Topic:
UI Frameworks
SubTopic:
UIKit
Tags: