Put it right after the visible mistake in the edit, preceded by sudden suspense when you want the failure telegraphed, and followed by sad violin when you want the aftermath to linger before the next scene starts.