I had the same issue and found the same link that is in your question. I used the same approach for the tab bar.
This is the code i am using and it works perfectly.
if #available(iOS 15.0, *) {
let appearance = UITabBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = customColor
self.tabController.tabBar.standardAppearance = appearance
self.tabController.tabBar.scrollEdgeAppearance = view.standardAppearance
}