WASHINGTON — More than 4,300 federal inmates were kept in prison beyond their scheduled release dates from 2009 to 2014 — some of them for an extra year or more, according to a report released on Tuesday that highlighted wide confusion in the prison system.

The findings by the Justice Department’s inspector general are a potential embarrassment for the United States Bureau of Prisons at a time when the Obama administration has assailed what it says are unfair and unduly harsh sentences for many inmates, particularly minorities and nonviolent offenders.

While it is unusual for an inmate to be held past his sentence, the consequences “can be extraordinarily serious,” the report said. The delayed releases “deprive inmates of their liberty,” and have led to millions of dollars in added prison costs and legal settlements with former inmates, it concluded.

The investigation found that in the most egregious cases, avoidable errors by prison staffers led to 152 inmates being imprisoned beyond their release dates.