Surprisingly, found a solution here: https://forums.developer.apple.com/forums/thread/711360
Adding the following in makeUIViewController() solved the issue.
@DTS Engineer @fandrade
controller.beginAppearanceTransition(true, animated: false)
Post
Replies
Boosts
Views
Activity
@DTS Engineer @fandrade Is there a bug raised/fixed already? Experiencing the same issue in TabView.
Even after doing as suggested by Frameworks Engineer the height returned is zero.