How to delete the remote files older than N days on schedule from SQL Server 2012 (with SqlServerAgent job)?
In order to make PowerShell errors cause a SQL Agent step to fail you have to make an adjustment to the $erroractionpreference setting. By default this value is set to Continue so the steps will show successful because no error is raised up for SQL Server Agent to detect an issue in the actual PowerShell command occurred.

You can put this at the top of your script that should fix that:
$erroractionpreference="stop".
This will allow the error PowerShell is returning to trickle up to SQL Server Agent process.