The argument passed to FreeAndNil must be an instance of a TObject descendant.
Prior to Delphi 10.4, the signature for FreeAndNil is untyped. This erroneously
loose contract allows any variable to be passed into FreeAndNil, which will cause
a runtime exception.
Remove the incorrect call to FreeAndNil - non-object types are either managed or
have an alternative way of freeing associated memory.