WordPress error uploading media come back later

Solution:

You could try to check if your wp_posts table is corrupted using the steps mentioned in this answer.

Check Auto Increment

You can check the wp_posts table using phpMyAdmin. Please ensure that you backup your database before making any changes.

From phpMyAdmin, select your site’s database and then click on the wp_posts table. Navigate to the Structure tab for the table. Check if the ID is set as the primary key and AUTO_INCREMENT is set for the ID as shown. If it is not, use the Change option to add the AUTO_INCREMENT in the Extra column.