i have the transaction in line 35
Hmm. I admit that I overlooked that since it's not the "usual idiom"...
sqlite3.Transaction:= TSQLTransaction.Create(sqlite3); // Your line 35
But in your program that works you've got
dbtrans:= TSQLTransaction.Create(nil);
sqlite3.Transaction := dbtrans;
...which /is/ the usual idiom. So there's two changes there: the first is that you're no longer relying on the connection object to store the (pointer to the) transaction object, and the second is the nil parameter.
Referring to the documentation root at
https://www.freepascal.org/docs.html hence via the FCL
https://www.freepascal.org/docs-html/current/fcl/sqldb/tsqltransaction.create.html:
"AOwner Owner of the transaction component."
Deferring to the example from @dseligo, I note that he also uses a nil parameter: I suspect that you were setting up some sort of circular reference.
I also admit to being slightly uncomfortable with the number of times different database components need to be told about each other, and am particularly uncomfortable when this is done using the object inspector (effectively embedded in the form designer) of a GUI app. But it's a complex area and by and large the implementers have done a good job making the same framework work over a fairly wide number of backends...
MarkMLl