I have had something similar happen but it was in 14. I had signed a guy on a free transfer and then he was sold by the team that I was signed him away from. I think it was Lewandowski and he wasn't on BVB, but I signed him and then he was sold to Real Madrid, I think and I didn't get him in that next season.
And on your last sentence don't let this one incident deter you from doing it. Because in 14 I bought Andrea Pirlo a lot for a sub in my midfield on a free transfer from Juventus and everything went fine. So my words of wisdom for you are if you sign someone on a free transfer don't go and buy him for a straight transfer, choose either free transfer and let him come in next season or sign him for a straight transfer and bring him in right away.