The team recalled rookie right-hander George Soriano from Triple-A Jacksonville in a corresponding transaction.
Barnes, 32, is 1-0 with a 5.48 ERA in 24 appearances (one start) in his first season with the Marlins.
Barnes played his first nine seasons with the Boston Red Sox, winning a World Series in 2018 and making the All-Star team in 2021.
Soriano, 24, made his MLB debut on April 16. He has no decisions and a 2.57 ERA in three relief appearances with Miami.