Hi @Thilina Tantirigama ,
According to the article, we can know that the site collection feature "Limited-access user permission lockdown mode" can indeed achieve what you said. Also, I didn't get a message about the feature change.
If the feature no longer works for you, please try another site to see if you can find out the cause of the problem.
And, there is a workaround for your reference.
First, only the site owner can share the site.
Then, for folders that do not want to be shared, just stop sharing.
Or limit sharing by setting unique permission on the folder.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.