That law that you mention requires only to publish news from officially registered media. At that moment there were officially registered not-pro-Putin media that could be used as a source (for example, covering anti-government protests, trial on Navalny and so on), but Yandex preferred to tune the algorithm so that it chooses news from pro-Putin media for the homepage that is seen by millions of people.
Yandex chose to become a propaganda outlet. Some of the news that they re-publish from propaganda media are very low quality and, I think, even violate Yandex's own rules. If you understand Russian, read this headline for example: [1]. For those, who don't understand Russian, the headline contains the word "shit" while describing (with rejoice) how Lyubov Sobol was denied to take part in Moscow State Duma elections. There was no law requiring Yandex to accept such publications for their news aggregator, but they accepted it.
[1] https://newssearch.yandex.ru/news/search?text=%D0%B1%D0%BB%D...
Rukipedia even has a section on incidents suggesting both manual fiddling with the YN output and the government's stuffing of it: https://ru.wikipedia.org/wiki/Яндекс.Новости#Критика
As for the example you cite: if it was found just in the ‘news search’, then it's possibly not from a source ‘certified’ for appearing in the main news feed—from what I've read, it seems that the search includes many more sources than the feed, and is possibly not regulated by that law.
[1] https://yandex.ru/news/smi?name=%D0%9C%D0%BE%D1%81%D0%BA%D0%...