Error: "No index available for ANSI join term"

I have two buckets in couchbase server:




I want to retrieve the maximum deaths value countrywise. Earlier it showed correct results, but now i am getting the following error:

               "code": 4330,
               "msg": "No index available for ANSI join term s",

Here is my query:

            SELECT d.country_name Country, m[0] AS Highest_Death, m[1]  AS 
            FROM demographics d JOIN `statistics` s ON 
           d.country_id = s.country_id GROUP BY d.country_name 
           LETTING m = MAX([TO_NUMBER(s.deaths), s.dt]) ORDER BY m[0] DESC

I want the result like this: highest death with country

               country_name       dt                     deaths
               GERMANY           2022-02-16       455
               BANGLADESH     2022-02-17       20
CREATE INDEX ix1 ON `demographics`(`country_id`,`country_name`);

CREATE INDEX ix2 ON `statistics`(`country_id`, deaths, dt);