Wiktionary
lose the plot
vb. 1 (&lit lose plot English) 2 (context idiomatic English) To cease to behave in a consistent and/or rational manner. 3 (context idiomatic English) To lose sight of an important objective or principle; to act contrarily to one's own interests through concentrating on relatively unimportant matters.