The country and Parliament have failed to agree, and it's pretty clear they never will agree; the wheels have fallen off the Brexit train not least because the people who voted for and campaigned to leave have been unable to agree amongst themselves what 'leave' actually means. Here's what should happen next:
Revoke Article 50, make it clear to the Leave folks that the matter is not ended, spend the next two years trying to do what David Cameron failed to do at the beginning of 2016 (whilst the EU might be a bit more predisposed to grant the concessions they told him to whistle for back then, having seen that the UK actually is stupid enough to jump off a cliff if it so desires), also spend the next two years fixing some of the problems - including the UK's own botched implementations of EU directives and regulations - which led to the slender Leave victory in the first place, put the matter to The People again in a binding referendum with a properly fairly agreed franchise and a realistic enhanced majority threshold (55% / 45% seems reasonable enough), and implement any subsequent second Leave victory in an orderly manner with a National Unity Government rather than a minority leader behaving like they've got an absolute divinely-sanctioned majority.
Nobody could argue such a course would be undemocratic, because the procedure would be legally binding from the outset, and all but the minority extremists on both sides will get what they want, and the rest of the rhetorical 90% of the population who never cared one way or the other until 2.5 years ago can see the country talk about something else for a bit.