How to Move Category position programmatically in Magento 2?

Move Category from one position to another using the move() method from the catalog module.

Function Definition from the interface Magento\Catalog\Api\CategoryManagementInterface,

$categoryId indicates the Category Id to move,
$parentId indicates the Parent id to move your category,
$afterId default value is null. The parameter is used to move your category after a specific category, at that time you have to pass category id value for this argument.

When you have $afterId value is specific category id and not null value, you have to pass $parentId value will be 2(Default Category)

Call the method from the PHP class to move the category position,

Output:
Boolean