Sending, receiving, and organizing email in Outlook.com
Hi
With more than 17,000 messages, this is likely a bulk-deletion issue rather than something you are doing wrong. Microsoft specifically recommends leaving Outlook.com open while deletion is processing and, if Empty Folder fails, deleting in smaller batches instead. https://support.microsoft.com/en-us/outlook/cannot-empty-the-deleted-items-folder-in-outlook-com
I would also try Settings > Account > Storage. Find Deleted Items there and use the option to permanently delete its contents. This can sometimes work when Empty Folder does not. https://support.microsoft.com/en-us/outlook/mailbox-storage-limits-in-outlook
If it still fails, delete a few hundred or around 1,000 messages at a time, then empty “Recover items deleted from this folder” after each batch.