Pups::ExecError: su postgres -c 'psql discourse -c "alter schema public owner to discourse;"' failed with return

This looks like the problem, though I cannot imagine how changing the plugins would have caused an issue with the postgres permissions. Have you changed something else? This is a standard install, right?

safe-mode will not help since the site isn’t working.