Delano businessman Gary Coll­yard’s efforts to withdraw his guilty plea for bilking investors in Bixby Energy Systems bought him at least eight months of freedom. But it could buy him a longer prison sentence now.

Collyard, 63, pleaded guilty in February 2012 to securities and bank fraud conspiracy charges related to the sale of Bixby stock, plus other real estate ventures. But as his sentencing hearing approached last August, he sought to withdraw his plea by accusing his former attorney of incompetence and of pressuring him to plead guilty.

That tactic backfired, voiding many aspects of the attorney-client privilege Collyard had enjoyed. Federal prosecutors used it to go after his former attorney’s files.

Collyard switched attorneys and eventually abandoned the bad lawyering allegation. Instead, he claimed that he was groggy from prescription drugs when he admitted his guilt.

At his plea hearing, Coll­yard acknowledged that he was responsible for $3 million in investor losses related to Bixby since January 2005. He also admitted to defrauding a number of area banks out of $1.3 million in business loans, much of which he spent for personal debts and lavish living expenses. Court records show several million dollars in court judgments against Collyard since 2005 even while he lived on a 50-acre estate and sent his children to the private Providence Academy in Plymouth.

Collyard underwent surgery for a drooping lower eyelid four days before his plea hearing. His doctor prescribed a low dose of the generic version of the painkiller Vicodin. A probation officer recommended that he stop taking the drug at least 24 hours before his plea hearing.

Collyard testified at the hearing that he had stopped taking it two days earlier. A urine test before the hearing found none of the drug in his system. Coll­yard said he understood what he was doing. He also said he was satisfied with his attorney and that no one had coerced him to plead guilty.

Federal prosecutors characterized Collyard’s efforts to undo his plea agreement as “frivolous” and alleged that his reasons were “patently false.”

On Tuesday, U.S. District Judge Susan Richard Nelson handed down a 26-page order rejecting Collyard’s claims. She found that he knew what he was doing and that sufficient evidence exists for his guilt.

Prosecutors will likely abandon an earlier request that Collyard be given credit for pleading guilty. Under federal sentencing guidelines, that could result in a longer recommended prison term when he is sentenced, now scheduled for June 25. He’s also scheduled to be sentenced Friday in Hennepin County District Court for tax evasion.

Collyard has told prosecutors that he conspired with Bixby CEO Bob Walker, 70, and former business consultant Dennis Luverne Desender, 66, in a plan to raise money for the struggling alternative-energy company based in Ramsey. But that cooperation may not do him much good now that prosecutors have branded him a serial liar in court filings.

The government alleges that about $43 million in investor funds was lost as Bixby tried to market technology in China that it claimed could convert coal to natural gas. Walker, best known as the founder of the Select Comfort bed company, has denied wrongdoing and awaits trial in January 2014 on fraud and tax charges.