HTTP 500 Internal Server Error: Argument #1 ($slots) must be of type array, null given

Illuminate\View\DynamicComponent::compileSlots(): Argument #1 ($slots) must be of type array, null given, called in .../vendor/illuminate/view/DynamicComponent.php on line 76

Getting the above error when using components. In our theme we have

<x-dynamic-component :component="'banner.' . $bannerType" />

and pass the $bannerType in Components class like the below

public function __construct()
    {
        $this->bannerType = $this->getBannerType();
    }

    public function getBannerType()
    {
        $field = get_field('banner_type');

        if ($field) {
            return $field;
        }

        return false;
    }

Not sure why we are getting this error as we are copying another we’ve built and it works fine in the other site.

Any help/suggestions as to why we may be getting this error is much appreciated.

Have you tried troubleshooting with GPT-s?

Might be useful: https://chatgpt.com/share/6751ce7b-a2a8-8003-907d-2762e3b83927