亡羊補牢(ぼうようほろう)

Japanese vocabulary

Meaning: locking the barn door after the horse has bolted; doing something too late; mending the pen after the sheep are lost

See it used in real works