This one was a bit of a headache to figure out. It turns out this is actually a bug in iOS 18. Apple officially added support for animating the tab bar while hiding it. Even after using the new API in iOS 18 for hiding the tab bar, I still encountered the same issue. Well, I figured out this is actually a bug in which hiding both the navigation bar and the tab bar at the same time will result in this visual glitch.
I managed to figure out a work around, and it seems to be working as intended now. Thanks for letting me know about this! I had not done any testing on iOS 18 until now, and I was able to fix a few other issues while I was at it.