TryStrToDate uses the ShortDateFormat elements of the FormatSettings record to determine which parts of the date string correspond to day, month and year. And it uses the FormatSetting's DateSeparator to separate the date parts - there is no "no DateSeparator" setting, just counting the 'y', 'm' and 'd' characters in the format mask does not work...
A more flexible way to convert string to date is the function ScanDateTime in the DateUtils unit:
var
d: TDate;
...
d := ScanDateTime('yyyymmdd', '20250525');