Export data from InterBase / Firebird database without credentials
The second error cannot attach to password database, that is given when the username and password are provided, is due to the fact that the security database couldn't be opened.

On macOS this file is located under:

/Library/Frameworks/Firebird.framework/Resources/English.lproj/var/security2.fdb

and is owned by the firebird user by default. This causes problems when the administrative tools (isql, gsec, gfix, etc.) are ran as a different user.

One way to solve this issue is to run those command as the firebird user. Another is to change the permissions of the security database:

chmod o+r /Library/Frameworks/Firebird.framework/Resources/English.lproj/var/security2.fdb

This solved the issue and data could be accessed using the default sysdba/masterkey credentials. These are not stored in the GDB file, but in the mentioned security2.fdb file, which explains why the default credentials can be used.