This is not supported in Firebird 2.1, terminating connections by deleting from MON$ATTACHMENTS
was added in Firebird 2.5 (The title says 2.1, but these are the 2.5 releasenotes). It requires that the database is ODS 11.2 (the database format version of Firebird 2.5).
The query you use is convoluted (why not just DELETE FROM mon$attachments WHERE mon$attachment_id = current_connection
), but it also makes no sense: If you want to kill your current connection, then just close the connection (note: I don't know Delphi, but I assume there is way to close a connection)! It is easier, faster and better.