I am pretty sure the unwritten (maybe written in some ‘how to keep you friends’ guide) rule that states you can’t date your friend’s ex-partner is very well known to everybody. Well, technically you can, but most probably you will need to choose between dating that person or keeping your friend – it’s almost never possible to have them both.
A similar situation was shared by one Reddit user whose best friend started dating his ex-girlfriend, which led to him setting boundaries and growing apart. After getting married, the friend thought everything would go back to normal; however, he was quickly reminded of the reality.
More info: Reddit