The genuine best efforts spanned from 2017-ish (negotiations didn't start in 2016 after the vote) to 2019. It took a while for the UK to realise the EU no longer wanted to be friendly and cordial, and that's when the UK's own stance finally changed.
A bilateral treaty between the UK and EU is not "international law". A bilateral treaty contains exit clauses that can be invoked if necessary. The Geneva Convention is an example of an international law. Though I don't know specifically what you are referring to in your example.