Williams has played a major part in helping Chester into the Conference Premier, and they were hoping to sign him on a permanent basis from Kendal Town.
"We're gutted we've lost out on the deal," said Chester boss Neil Young, whose side won the Conference North.
"I'm not a defeatist but when a player like Danny gets away - who we've scouted and chased and chased and chased - it's a massive blow as he fits everything we're trying to do.
"It's a great move for the lad and on the flipside it's great credit to what we've done for him here at Chester - he's going from Kendal to play in the Scottish Premier League. It's not all done and dusted yet but it's nearly there.
"We wish him well and he's another of those little nuggets we've found over the three years."