are you sure its the tsqlite that creates the problem and not the writeln? Have you checked the project's options to make sure that the win32 GUI option is not set? IF it is set then there is no console to writeln to.
Its run under Visual Studio Code with pure command line Fpc compilation. I have other pieces of code, where this is not a issue. Forcing it to use -WC still result in the same lack of output. Your right, running it as a stand alone executable trigger a GUI error, what makes no sense.
Fpc sqlite.pas
* Console:= No error, no output
* Starting exe from file explorer. Console Box + GUI Error
Fpc -WC sqlite.pas
* Console:= No error, no output
* Starting exe from file explorer. Console Box + GUI Error
Fpc -WG sqlite.pas
* Console:= No error, no output
* Starting exe from file explorer. GUI Error
For some reason, the sqlite3db TSQLite is triggering a GUI despite being compiled to console. Looks like a bug in sqlite3db...