I am trying to define a category for the node I am developing.
Using the decorator, I can assign the new node to a custom category in the classic interface. But this doesn’t apply to the modern UI (See below Classic vs Modern and the code).
Sorry for the late reply — and thanks for sharing the details!
Your code looks correct. Unfortunately, in the current Python Extensions development mode, node categories are not yet supported in the Modern UI. That’s why you’re only seeing the effect in the Classic UI.
The good news: if you build your extension and install it from the update site, the category will appear correctly in both the Classic and Modern UIs.
Tip: For community extensions, it’s recommended to use the "/community" category as the top-level entry point.