Thanks to @herglotzmarco the logout button can now become functional. You need to enable a capability for it which allows configuring a custom logout URl, but that field is optional (OAuth2 Proxy users can leave it empty, Authentik users need to fill in the right URL).
Important note: If you encounter unexpected behavior concerning this logout functionality after updating, delete your browser cache. Nexus caches scripts for 30d.