Sometimes macOS tries to help you by not letting you carry out actions that would break the system or software you’re using. There are extra levels of warnings available that you might choose to turn off or bypass.
When you have files in the Trash, select Finder > Empty Trash prompts you as to whether you really meant to empty the trash. You click Empty Trash to proceed. Holding down Option when selecting Finder > Empty Trash bypasses the warning. (You can also press Command-Option-Shift-Delete to bypass it.)