It’s related to the term crossed the line, which I believe originated with Cesar crossing the rubicon. Crossing the line means breaking some rule or taboo in a way that has significant or permanent consequences. Walking up to the line is getting close without crossing.