I think this is possible without an array formula. maybe:
=MAX(INDIRECT("H"&MATCH(G5-365,G:G,0)&":"&"H"&ROW()),0)
would suit (if you are flexible about leap years!). (Will return #N/A until there are more than 365 days of data).
Edit Same result but without errors showing:
=IFERROR(MAX(INDIRECT("H"&ROW()-369&":H"&ROW())),"")