After removing references to the code that you don't supply...
...and tweaking what remains, this works for me:
private func setupUserLocationButton() {
let button = CLLocationButton()
button.icon = .arrowOutline
button.label = .none
button.cornerRadius = 25.0
button.addTarget(self, action: #selector(userLocationButtonTapped), for: .touchUpInside)
view.addSubview(button)
// setting up constraints for CLLocationButton to be on the top right corner
button.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
button.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 16.0),
button.trailingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.trailingAnchor, constant: -16.0)
])
}
Maybe take it from there, and re-add your customizations, one-by-one?
Xcode 13.2 (13C90)
(From the Developer website, not the broken App Store version 13.2)