No, that's not accurate. There are other countries that will allow you to enter with a Canadian visa and a Sri Lankan passport.
Here's an article that lists a bunch.
https://www.visatraveler.com/blog/travel-20-countries-visa-free-with-canada-visa/
Of course you will need to double check with the embassy of a specific country.
I looked up Costa Rica and the article is correct.
Source ->
https://www.costaricaembassy.com/visas.php#
Sri Lanka is a Group 4 country.
For the nationals of group 3 and 4 countries that need a visa to enter Costa Rica, exceptions apply in the following cases:
- Nationals of countries listed in the Third and Fourth Group who have a multiple entry visa (tourist visa, a visa for crew members or a business visa) to enter the United States (exclusively visa types B1-B2, visa type D or visa C1/D of multiple entries), Canada (exclusively multiple entry visa), stamped in their passport may enter Costa Rica without a consular visa. The maximum stay will not be longer than the validity of the visa and will not exceed 30 days.
- Nationals of countries listed in the Third Group and Fourth Group who have a legal permanence that allows multiple entries, and with a minimum validity of at least six months in the United States of America, Canada, and the countries of the European Union, are exempted from Consular Visa to enter Costa Rica. The six month validity period will be counted from the day of entry into Costa Rica. The maximum stay authorized will be 30 days and the passport must be at least six months valid. Those nationals, who don’t have the minimum required residence of six months, can apply for a Consular Visa in the corresponding country. This exception is not applicable to people with permanent legal residence as refugee, in which case a Consulted Visa has to be requested.