If you get one of your backlinks reported as “lost” while it’s still on a page, this can mean that a page where a reported backlink is placed gained a rel="canonical" link element to another page.
In this case, Ahrefs bot indexes a backlink only on a page that was labeled as canonical (preferred) and won’t take into account backlinks on its duplicate pages.
A rel="canonical" attribute is used when the duplicate or almost identical content is repeated on different URLs.
To help Google determine which page should be preferred when indexing, it’s recommended to add a <link> element with the attribute rel="canonical" to the <head> section of all the similar pages.
In pages’ HTML, it will look like this:
<link rel="canonical" href="https://blog.example.com/dresses/green-dresses-are-awesome" />
(Where https://blog.example.com/dresses/green-dresses-are-awesome is a preferred canonical link.)
You can find more information about page canonicity here: https://support.google.com/webmasters/answer/139066?hl=en