There are quite a few questions similar to this one, but I can't get any answers to work.

I run Magento 2.4.2 and tried to add a custom attribute with the instruction here:

<https://devdocs.magento.com/guides/v2.4/ui_comp_guide/howto/add_category_attribute.html>

I have created the two required files in my module (`InstallData.php` and `category_form.xml`) with the following differences:

InstallData.php:

```
     public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
     {
         $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
-        $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'attribute_id', [
+        $eavSetup->addAttribute(\Magento\Catalog\Model\Category::ENTITY, 'myattribute', [
             'type'     => 'int',
-            'label'    => 'Your Category Attribute Name',
+            'label'    => 'My Category Attribute Name',
             'input'    => 'boolean',
             'source'   => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
             'visible'  => true,

```

```
 <form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
     <fieldset name="display_settings">
-        <field name="attribute_id">
+        <field name="myattribute">
             <argument name="data" xsi:type="array">
                 <item name="config" xsi:type="array">
                     <item name="dataType" xsi:type="string">boolean</item>
                     <item name="formElement" xsi:type="string">checkbox</item>
-                    <item name="label" xsi:type="string" translate="true">Your Category Attribute Name</item>
+                    <item name="label" xsi:type="string" translate="true">My Category Attribute Name</item>
                     <item name="prefer" xsi:type="string">toggle</item>
                     <item name="valueMap" xsi:type="array">
                         <item name="true" xsi:type="string">1</item>

```

After running `bin/magento setup:upgrade` and `bin/magento c:c` the user interface shows the checkbox:

[![new checkbox](https://i.stack.imgur.com/FT8Tb.png)](https://i.stack.imgur.com/FT8Tb.png)

So the overall procedure went fine. But now I try to change the value of the checkbox and save the default category by clicking on the red "Save" button on the top right, the checkbox state is not saved and restored back to off.

Where can I start looking for the error?