Most likely that Koan comes from Linji Yixuan aka 1600 years ago, but Buddhism is likely 2400 or older years ago.
-----
Linji Yixuan also has another saying "If you meet your forefather, kill him" once again this is not literal but is once again excessive reverence to other relationships instead of finding family in all things not just a specific forefather.
A similar statement would be Jesus Christ in the Gospels such as Luke saying you can't be his follower if you love your father, wife, children, siblings, etc more than him. Jesus demanded you love him more than you love your own life, and your duty to his faith is greater than your traditions saying "I must wait" to follow you for first I must bury my dead father and so on. [Once again it is probably not supposed to be taken literally for the Gospels choose certain metaphors for dramatic effect about how one organizes ones priorities.]