Hi @fschuurman,
I have made a test on my side and don't have the issue that you mentioned.
Please add a Compose action before the condition to get the value of expression below:
toLower(items('Apply_to_each')?['Name'])
And then check if the value of expression contains ".pdf".
The screenshot of the flow as below:

The expression in the condition as below:
@contains(toLower(items('Apply_to_each')?['Name']), '.pdf')
The flow would run successfully as below:

Best regards,
Alice