Have you recently faced any errors while saving any product category from your Magento admin? Did something went wrong while saving the category Magento 2?
Which might look something like this.
Then we have found a solution to solve this error.

This category save error in Magento generally means you cannot create any new category or update an existing one.
Various factors cause such an error, but the most common one is the Magento version and the patches in those versions. Here you don’t need to switch to an entire new version, you just need to follow the two steps below to solve this error.
Solution for Category Save Error In Magento
Step 1:
Head to your patch_list table in your Magento database. Then find and delete ‘Magento\Catalog\Setup\Patch\Data\UpdateCustomLayoutAttributes’
Step 2:
Then run this command php bin/magento setup:upgrade
and that’s it.
When you run this command, Magento will check and apply any required changes in the database. The command ensure that the database synchronizes with the code changes and letting the new funcationalites work perfectly within your store.
Try out this yourself and I believe you will be able to see the results. You can also set product position in a category programmatically in Magento 2 as the product position value determines the order of products on the category page.
& if you found this solution helpful do share with your Magento community!