502 Bad Gateway - Niet in staat om opnieuw op te bouwen

You could try to add to your rebuild command the --skip-prereqs flag (but be sure to have downloaded a backup and your app.yml beforehand, just in case)