On Feb. 8, 2017, Mr. Cruz’s failing grades forced him to withdraw from school. On Feb. 11, 2017, he legally bought an AR-15 assault rifle. It would be used a year later, almost to the day, when the authorities say he returned to Stoneman Douglas on Feb. 14 and killed 17 students and staff members in one of the deadliest school shootings in American history. Mr. Cruz, now 19, remains in jail awaiting trial on charges of capital murder.

The new details about Mr. Cruz’s educational record come from a consultant’s report commissioned by the Broward school district to review how it handled Mr. Cruz’s education. A judge ordered the release of the review, conducted by the Collaborative Educational Network of Tallahassee, over the objections of Mr. Cruz’s defense lawyers after several news organizations, including The New York Times, sued to make it public.

The report found little fault in the school district’s handling of Mr. Cruz’s special needs. Yet two key errors his junior year left Mr. Cruz without therapeutic services from the district for more than a year before the shooting and prevented him from returning to Cross Creek, the only high school where he had improved his behavior and found some academic success. They are the latest in a series of lapses by federal, state and local officials who came in contact with Mr. Cruz during his troubled teenage years but failed to take actions that might have prevented the shooting.

“We accept the recommendations regarding procedural improvements, and are pleased with the overall review, recommendations and findings,” Robert W. Runcie, the Broward schools superintendent, said in a statement on Friday. “We are actively reviewing our policies and procedures, training protocols and data systems in an effort to implement the recommendations in a timely and effective way.”

Much of the educational report was redacted, as approved by Circuit Judge Elizabeth Scherer to protect Mr. Cruz’s privacy. But the text of the blacked-out document could nevertheless be extracted, copied and pasted into another file so that it could be read in full. The content of the unredacted document was first reported by The Sun Sentinel of South Florida.