hiii
i have had the same problem
after too many trials i did what is said here
it works well check this
https://www.lancelhoff.com/enable-or-disable-comments-on-all-posts-in-one-step/
all u need is to excecute 2 sql query in your database
UPDATE posts p SET comment_status = ‘closed’, ping_status = ‘closed’ WHERE comment_status = ‘open’;
and this
UPDATE posts p SET comment_status = ‘open’, ping_status = ‘open’ WHERE comment_status = ‘closed’;
read the link 4 more detailed info
good luck :)))