As bugtracker is currently offline, I report bug here to not forget.
The error occurs from the revision 64985:
https://svn.freepascal.org/cgi-bin/viewvc.cgi?view=revision&root=lazarus&revision=64985Tested on Lazarus trunk, Windows 10 and Debian 10.
Steps to reproduce:
1. put TSQLQuery on the Form
2. right mouse button on a sqlquery component
3. select "Edit Fields..."
4. create new field
5. close a "Edit Fields..." window
6. delete a SQLQuery component