According to Matt Maiocco, the team did know that there was a possibility that the rehab might take more time. It should also be noted that the 49ers have a good working relationship with Williams' agent Drew Rosenhaus so it is very unlikely that there were any false pretenses in regards to the 5 year extension. Both sides are reportedly happy with the one year agreement.
One of the positives of the 2016 off season was the 5 year extension of NT Ian Williams. Prior to signing his contract however, Williams did not pass his physical and news came out that he had undergone two ankle surgeries during the offseason to fix injuries that have kept him out of games in previous seasons. Williams' restructured contract is a one year 6 million dollar deal with no guaranteed money and is heavily incentivized.
Adam Schefter reported this development on ESPN's NFL Insiders (video above), also saying that there is no guarantee that Williams will be ready to play at the beginning of the season. Former GM Mark Dominik, currently an ESPN analyst, added that the surgeries were done without the team's knowledge.
In an article on ESPN following up with Schefter, Field Yates, however, reported that Williams' agent, Drew Rosenhaus, "has been very up-front from the beginning that his client underwent a procedure after the season."
Whether the 49ers knew about the surgeries or not remains unclear. What does seem to be more apparent is that players are seeking medical attention away from the team facilities and physicians, indicated by this new development as well as Colin Kaepernick's surgery and rehabilitation in Colorado. Depth chart issues aside, there is plenty to unravel with this latest injury news.