People have been wanting SY and Holland before him to turn over every rock in search of solutions to what for a long time was a really thin pool of prospects or good young players. Take some risks, look beyond the beaten path, etc. I would bet there were some concerns about Walman even at the time he was signed to the three-year extension. Probably nothing major, but something they thought they could live with or Walman able to deal with, with a little time and help. There are very few mysteries about players in the NHL. It's as Lazlo said, a tight-knit community not only of GMs, but players, coaches and staff that is constantly moving from team to team. Walman was a bit of a mystery to fans -- "Walman's better than Leddy! What was St. Louis thinking?" -- but probably not within that small NHL community. Walman, if had any sense at all and looking ahead to imminent Free Agency, would have been on his best cooperative behaviour that season because the payoff for that could be measured in milllions.
Walman in his final year as an RFA looked like he might be one of those unexpected solutions. A trade throw-in who was playing top pair minutes, could skate, had a great shot. He hadn't yet burned any bridges with teammates, or many of them, or been a major problem. They had to make a decision on him prior to the 2023 TDL: make him an offer good enough to keep him from opting for Free Agency, or trade him for whatever they could get at the TDL, probably a mid-round pick at best. So they took the risk, the potential upside of keeping that asset outweighing the value from a later Draft pick. For fans tempted to criticize SY for signing him, or even despite all the evidence critical of his last move, the choice is either to think SY made a mistake in keeping Walman and then compounded it, or realize he was prepared to take a risk and when it went south, made the best out of a bad situation.