As previously said, what you are attempting to use is called Google AdSense Auto Ads. Auto Ads are currently not compatible with most forums or any site with a complex layout like XenForo. Auto Ads have the possibility of breaking your page structure, as you have come across. In the future this may change but currently Auto Ads are not smart enough to not cause formatting issues on complex layout sites like XenForo. It has been this way for years, you just can't use them on XenForo without issues.
Most forums that use Google AdSense setup specific sized ads for specific locations. You can also use responsive ads (ads that automatically adjust their size, appearance, and format to fit the available ad space) but again these must be setup for specific locations.