It looks like the issue might be related to the order in which Alpine evaluates directives. In some cases, directives like x-show are evaluated before custom magic is initialized, which means that the magic isn't available yet.
One solution to this problem is to use the x-data directive to initialize your component and make sure that the custom magic is available before any other directives are evaluated. Here's an example:
<div x-data="{ $option: $option }">
<span x-show="$option.isExpanded"></span>
</div>
In this example, we're using the x-data directive to create a new Alpine component and pass in the $option object as a property. This ensures that the custom magic is available before any other directives are evaluated.
Note that we're wrapping the x-show directive in a div element. This is because the x-data directive needs to be attached to an element in order to work properly. If you don't want the div element to affect your layout, you can use CSS to hide it:
<div x-data="{ $option: $option }" style="display: none;">
<span x-show="$option.isExpanded"></span>
</div>
This will ensure that the div element is hidden, but still allows the x-data directive to work as expected.
I hope this helps! Let me know if you have any questions.