Pups::ExecError: postgres ユーザーで 'psql discourse -c "alter schema public owner to discourse;"' を実行したところ、失敗しました

I am nnot fully sure of the procedure but you might be able to load the site in safe mode.

@JammyDodger can you link the procedure for safe mode?