Restore cache not working after a failed step

Hi Team,

Today I noticed that the restore cache step did not work if any of the previous steps have failed. I tried using the always clause, but that did not help either. It works correctly if there are no failures in any of the preceding steps. Just wanted to check if this behaviour is by design?