It seems that I have discovered what happens, but I am not sure how to reproduce.
I visually configure some SQLTransaction and SQLQuery in a form. When all is right, I save it and close Lazarus.
I open the LFM file in Notepad++ and the information in SQLQuery.Transaction has been saved correctly.
I open the project in Lazarus again and the information in SQLQuery.Transaction is loaded wrongly. It even seems random. It might be related to many open forms simultaneously when saving and loading.
If I recompile that unit, then when I run the application, errors come up and that do not make sense since it worked correctly before.
I reconfigure the SQLQuery.Transaction of that form and the application returns to work.