It fails because you aren't using a language neutral datetime format. You are assuming that SQL Server understands that the day comes first, then the month and finally the year.
When you run this interactively using SSMS, you are using a login (as in the CREATE LOGIN command) that has a dateformat the correspond to that order. I.e., your login's dateformat is dmy.
Agent is using a different datetime format for its login, evidently. That is why it fails. Perhaps it is mdy (the default for us_english).
What you want to do is to use a datetime format that doesn't depend on the datetime setting for the login - what I like to call a "language neutral" datetime format. The YYYYMMDD is one such format. Here's your expression converted to that format:
select LEFT(datediff(day,GETDATE(),'20' + '26' + '0831')/365.25,2) AS test
Another option is to add SET DATEFORMAT before your expression:
set dateformat dmy
select LEFT(datediff(day,GETDATE(),'31/08/20'+'26')/365.25,2) AS test
Here's an article regarding datetime that I have written: https://karaszi.com/the-ultimate-guide-to-the-datetime-datatypes
I wouldn't mess about with Agent's language! You never know what might break. Just use the dateformat command or (preferably) use language neutral datetime format.
'31/08/20'+'26'
what on earth is that supposed to do? The result is probably'31/08/2026'
which probably wasn't the intentionDATEFROMPARTS
and some arithmetic might be a better solution, then you don't need any conversion