A care assistant has narrowly avoided jail after lashing out at a man he was meant to be caring for and punching him twice.