Magento 2.4 seems to have an issue with marking part refunded orders as complete even after invoicing and credit memos have been created. It seems that if a customer ordered 5 of an item and only 4 were in stock, it’s always a struggle to mark an order complete and it remains pending. This only happens with partial refunds, not full refunds or any other orders.
Until a fix can be found I’ve been setting the order status for partially refunded orders to complete directly in the Magento 2 database.
Solution to marking Magento orders complete
Find your order entity_id via the Magento admin. This should be the first number in the url of that order in Magento admin.
Then using PHPMyAdmin login into your db admin panel and look for that entity_id in the two tables below.
The tables are ‘sales_order’ and ‘sales_order_grid’
Then manually change the status from pending to complete. I hope that helps.