Can't upgrade from 3.2.1.1 to 3.3.0.14

Trying to perform web upgrade from 3.2.1.1 to 3.3.0.14 but it fails with Gateway timeout.

|OS platform|Linux|
|PHP version|7.3.33|
|Apache version|Apache/2.4.37 (centos) OpenSSL/1.1.1k|
|Database driver|mysqli|
|Database server version|10.3.28-MariaDB-log|

[21-Feb-2023 09:19:59 Europe/Belgrade] PHP Fatal error:  Uncaught Error: Call to a member function getConnection() on null in /home/vetglasnik/www/lib/pkp/lib/vendor/laravel/framework/src/Illuminate/Database/Capsule/Manager.php:74
WARNING: The NavigationMenu (ContextId: 5, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[21-Feb-2023 09:19:59 Europe/Belgrade] WARNING: The NavigationMenu (ContextId: 5, Title: Primary Navigation Menu, Area: primary) will be skipped because the specified area has already a NavigationMenu attached.
[21-Feb-2023 09:19:59 Europe/Belgrade] WARNING: The NavigationMenu (ContextId: 0, Title: User Navigation Menu, Area: user) will be skipped because the specified area has already a NavigationMenu attached.
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 1 with submission_id 1
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 1026 with submission_id 73
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 1027 with submission_id 73
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 1030 with submission_id 74
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 1034 with submission_id 74
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 3883 with submission_id 171
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 3884 with submission_id 171
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 3885 with submission_id 171
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 3887 with submission_id 172
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 3888 with submission_id 172
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 3889 with submission_id 172
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 3890 with submission_id 172
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 4357 with submission_id 191
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 4919 with submission_id 208
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 4921 with submission_id 209
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 4999 with submission_id 217
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 5268 with submission_id 232
[21-Feb-2023 09:20:01 Europe/Belgrade] Removing orphaned submission_files entry ID 5338 with submission_id 235
[21-Feb-2023 09:20:18 Europe/Belgrade] A submission file was expected but not found at journals/5/articles/37/submission/query/37-60-705-2-18-20170505.pdf.

I’ve looked at other similar topics but not sure how to procede. Fatal error was supposed to be fixed some versions ago, but we’re still getting it.
The file mentioned in the last line doesn’t exists in either files directory or in a database backup, but the entry is somehow created during upgrade and then appears in database. I’ve seen encoding being mentioned in one other topic and we have both utf8mb4_unicode_ci and utf8_general_ci entries in the database. If I am to try to change these would it mess up data?