Boris Johnson has been accused of trying to “frustrate” the law that required him to seek a Brexit extension if a deal had not been agreed.
The prime minister has sent an unsigned letter to Brussels asking for a delay, along with a second letter saying he believed any delay was a mistake.
Leading SNP MP Joanna Cherry said the second letter, which was signed, may be a violation of the so-called Benn Act.
Scotland highest court is due to meet on Monday to consider the matter.
Ms Cherry told the BBC the fact that Mr Johnson had been forced to send an extension request was a victory for campaigners seeking to rule out a no-deal Brexit.
But she pointed out that at the Court of Session earlier this month, the government gave an undertaking not to frustrate the act.
The court had been asked to sign a letter on the prime minister’s behalf if he failed to do so, but delayed giving a ruling until Monday to allow the political debate to play out.
Ms Cherry added: “As a matter of law it is arguable that the prime minister’s signed letter seeks to frustrate what the Benn Act sets out to do. The principle of frustration is well recognised in law.
“When we were in court in Edinburgh the prime minster gave promises that not only would he obey the Benn Act but that he wouldn’t seek to frustrate it. Now arguably that is what he has done.”
Scottish Conservative MP Luke Graham said he was “cautiously optimistic” that Boris Johnson’s deal would be passed in the Commons next week and he insisted the prime minister had complied with the law.
He told Sunday Politics Scotland: “The prime minister has written his letter in accordance with the law and now we are focusing on getting a deal.”
He added: “We want to try to get a deal and we’ve got one on the table. It’s time for MPs across the House of Commons to come together to vote for that deal so we can move forward.”
Labour has said it plans to amend the deal when the legislation is brought to Parliament, for example by demanding a UK-wide customs union with the EU and single market alignment.
Shadow Brexit secretary Sir Keir Starmer also said Labour would support an amendment requiring the deal to be put to another referendum.
The SNP’s Westminster leader Ian Blackford said the priority should be to seek a Brexit extension and, once that was secured, his party would press for a no-confidence vote.
“Once we have got that position of safety, once the extension is in place, I would call on all opposition parties to come together. The SNP is prepared to accept its responsibility,” he said.