It was September 2024 when Mangan, who made 59 league appearances for Town over two stints, was linked with a move to the Bernabeu.
The 38-year-old was going to link up with boss Carlo Ancelotti, but his move to Spain was pulled from underneath him due to a work permit issue.
As a coach, Mangan has had a spell as caretaker manager at Bristol Rovers, a place where he was also assistant to Joey Barton.
The move to Madrid came about due to his relationship with Davide Ancelotti, the son of Carlo - they met while doing their UEFA coaching badges together.
He will now join up with Davide at Botafogo, a side that play in the Campeonato Brasileiro Serie A and are based in Rio De Janeiro.
Mangan has been the first-team coach at Stockport County, where they finished third in League One last season under Dave Challinor.
During his time in Shropshire, he netted 16 times across all competitions. He finished playing in 2019 after a spell at Accrington Stanley.