The strange journey of Juan Nicasio has brought him to the St. Louis Cardinals in a rare post-trade-deadline deal, with the Philadelphia Phillies getting a utility infield prospect in return for their waiver claim of Nicasio, a "something is better than nothing" move for them that also boosts St. Louis' shot at a wild-card spot.
The Pirates had Nicasio but didn't find a suitable trade offer for him in July before the non-waiver trade deadline. When he was claimed by a team in August before the waiver trade deadline, the Pirates didn't like the offer and chose instead to release Nicasio to give him a chance to end up on an American League team via a release waiver claim. The order of claim priority differs for release waivers (which is by record) and trade waivers (which is by league).