All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad is His slave and Messenger.
Compulsion (being forced) differs according to the matter a person is compelled to do. So being forced to utter the words of Kufr is not the same as being forced to give one's property as a gift or a donation and the like.
Shaykh Ibn Taymiyyah stated this and mentioned that being forced to utter words of Kufr is when one is being chained or severely beaten. Also, many scholars, such as the scholars of the Maaliki School of Fiqh, stated that being forced to commit Kufr is only established when the person fears to be killed. Some scholars of Fiqh added fearing to lose an organ or part of his body.
Some other scholars are of the view that if the person risks to have much of his money stolen or the like, it is also considered compulsion, as stated by Ibn Hazm .
Az-Zuhayli said, “The Shaafi'i and Hanbali Schools, as well as the Thaahiriyyah, gave concession to utter words of Kufr when one does not fear losing his life or a body part; because many incidents of compulsion to utter Kufr at the beginning of Islam were of this nature. This is the preponderant view among the two views on the matter.”
Hence, you come to know that the scholars differed in opinion about this issue, and it is better for the forced person not to utter the words of Kufr unless he fears losing his life or having part of his body permanently impaired and the like.
Allah knows best.