Hello Sergey,
Thank you for the report and test case.
Imho you forgot to attach patch here but for now I've used patch(mdev10790-mysql-5.7.diff) from the original bug report to reproduce.
Thanks,
Umesh

Confirm Laurynas's finding. Bug#78401 is the same issue. The difference is manifestation - this bug shows how a suffers from index cardinality stats, while in #78401 filesort code suffers from wrong results ofstimate_rows_upper_bound() call.