The glitch, in software used by the criminal justice system to help decide whether someone should be released from prison and what additional measures they should be subject to, affected 1,317 cases.
Justice secretary Keith Brown said up to 780 prisoners may have been released back into the community despite the calculation of their risk to the public being wrong and unchallenged by justice system professionals.
The SNP minister said he did not know whether this error may have impacted how the criminal justice system made their decisions around the possible early release of murderers, rapists and other violent or sexual offenders.
The error could have influenced decisions made about whether offenders were released from prison early in their sentence and may have seen serious offenders not be subject to additional monitoring.
Some individuals may also have wrongly seen longer jail terms or heightened security due to the system overstating the risk to the public due to alcohol or drug use.
Opposition politicians labelled the revelations “profoundly concerning” and a “grave concern”, and called for the Scottish Government to ensure transparency around its impact.
The error was set out by Mr Brown in a statement to Holyrood on Thursday that was scheduled at the last minute.
He outlined the glitch was first highlighted in January by a single Scottish Prison Service user, with the government informed last Friday.
The problem, which resulted in the actual “numerical risk score” not matching the “risk score level” on display for users of the software, affects the LS/CMI risk assessment tool that is used by most bodies involved in criminal justice.
Criminal justice system staff use this system to inform them of the potential risk an individual might pose when deciding whether to grant them early release, parole or enforce additional monitoring, but the Government stressed any final decision was made by professionals, not solely the risk assessment software.
Mr Brown said: “A systems issue appears to be preventing any subsequent changes made to that risk level when new information has been entered.”
In total, 1,317 of these risk assessments used by the justice system presented the wrong overall risk level.
Of these, 285 relate to “open cases”, which includes individuals still being monitored by the justice system by social workers, the police or other criminal justice bodies.
The justice secretary said 150 of these had already been checked, with officials stating there was a public protection risk resulting from the glitch.
A further 495 “closed cases”, which includes former prisoners now released back into the community, also showed the same error, Mr Brown told MSPs.
All the other closed cases were subject to manual overrides by staff exercising their professional judgement on the potential risk posed by an individual.
Some of the 780 total cases where the error occurred include instances where the risk level was higher than displayed, downplaying the potential risk to the public an offender may pose.
However, a number overstated the risk to the public based on the alcohol or drug use of an individual, he said.
Social workers have been tasked with a full review of all ‘open’ cases, Mr Brown said, with cases due for consideration of early release, entrance into MAPPA which manages the risks of violent or sexual offenders, or onto licence being prioritised.
Mr Brown said: “There is a much bigger piece of work to go back through the history of this right back to 2012 and make sure that even the closed cases, that we got it right in relation to those as well.
"It is important to reiterate that as a result of this issue, no concerns have been expressed by social workers both in the community and in prison around any offenders within the justice system. Our approach will always be precautionary and evidence based."
Asked whether he knew which type of offenders may have seen incorrect risk assessments, Mr Brown said it would not be possible to say whether it covered sexual or violent offenders.
He said: “It wouldn’t be possible to break it down as far as I am aware to those cases because as I mentioned during the statement, there are a number of different tools used for different offences and used often in conjunction with other tools, all of which are used in conjunction with professional judgement.
"But I will look into that and see if there is more information I can provide.”
Scottish Conservative justice spokesperson Jamie Greene criticised the heavy use of jargon in the statement and labelled the error “stark” and “shocking”.
He said: "We know why this mysterious, last-minute statement on justice was kept quiet until it was released to us.
"Wow, clouded in jargon, it all sounds like a simple technical error off the back of another bungled IT centralisation project, but the reality could not be more stark or actually shocking.
"These are vital systems that are used to score criminals and their risk to the public before they are released early.
"The admission today that there are potentially hundreds of cases where the risk for assessing that danger was wrong, will and should be a source of grave concern to us all.
“[There were] 495 of them. It is shocking. They haven’t found any public protection risk yet because they don’t know the full picture yet.”
Liam McArthur, the Scottish Liberal Democrat’s justice spokesperson, said the error was “profoundly concerning”.
He said: “This fiasco is profoundly concerning and will give rise to understandable public alarm.
“Over 1,000 people could have either suffered longer sentences, or been released much sooner than they should have. There are no winners in this situation.
“The Cabinet secretary sought to reassure Parliament and the public. However, a statement heavy on jargon, but light on detail falls far short of what’s needed. The Government needs to clear up the outstanding questions without delay.”
The justice secretary said there would be more clarity around the issue in around a fortnight.