Ernie was on rounds - almost finished - when he walked by the greenhouses on route back to the castle. Wand lit, he scanned for anyone who was still out, but he wasn't expecting to find anyone - with the exception of giant spiders, patrolling the grounds was generally not a strenuous task.
But he did see someone. Lying on the ground and silent, Ernie had a flash of worry - was it a dead body? It wasn't such a stretch, given that there were Death Eaters in the castle, but he didn't think they were planning on killing anyone just yet. At any rate, he certainly hoped not, as he wasn't sure what the protocol would be for that.
Cautiously, he approached. His fears about it being dead were alleviated when he heard a noise - but he also knew that that noise sounded like pain. "Hello?" he asked into the night air. "Who's there? Are you alright?"