In your previous post (in another thread) it was suggested, that this issue on github could be the reason for the errors, as RANK is now a reserved keyword in MySQL 8.
Have you tested, if the errors disappear, when you change these lines (formaliciousfield, formaliciousform, formaliciousstep) and maybe other occurrences in the code to
$criteria->sortby('`rank`', 'ASC');
The problem for the Gallery extra could be the same, as the database tables modx_gallery_albums
and modx_gallery_album_items
also have a column named “rank”.