Based on reports that Yzerman made this trade to acquire Kostin, and is currently trying to get him signed, my guess is that....
Yamamoto is at best a backup plan in terms of the roster spot they are trying to fill with Kostin. If Kostin doesn't sign, maybe Yamamoto has a spot. But more likely, since he's a completely different type of player, Yamamoto was nothing more than the cost of doing business, and the buyout is inevitable regardless. And Yzerman would have had a high degree of confidence in signing Kostin when the deal was made. Which is all fine, Yamamoto is a cheap buyout, nothing to worry about given Detroit's massive cap space the next couple years at least.
Kostin would be a fine replacement for the Erne/Sundqvist/Chiasson-type role. He only just turned 24.