how can i get an accurate count based on max date when joining 3 tables when one of the join fields is many to 1?
mmm based on your sample date your query is not wrong. but your expected results are wrong.
select
    a.task_code,a.sol_id,a.cur_id
    ,b.m_id
    ,c.groupid
FROM
    task_table AS a
    inner join worktable AS b on a.sol_id = b.sol_id
    inner join grouptable AS c on b.m_id= c.m_id
    where
        a.cur_id = 1 and a.task_code is not null
ORDER BY c.groupid, b.sol_id;

select
    c.groupid
    ,count(c.groupid) AS group_count
    ,a.task_code
from task_table AS a
join worktable AS b on a.sol_id = b.sol_id
join grouptable AS c on b.m_id= c.m_id
where
    a.cur_id = 1 and a.task_code is not null 
group by
    c.groupid, a.task_code
;


the group_id A76 is linked to the work table with sol_id 23,24 and 42; 23 and 24 are task_code A. 42 is task_code B.
Y23 has two m_id that connect sol_id 45 and 83 to task code A and B.
So the second output in the image is as you expect but has 2 more rows related to the task B.
Maybe the sample date is wrong because a can't see a wrong result to fix.