The below quotes are taken from Bibek Debroy's English translation of Valmiki Ramayana.
In this world, I would not be slain by any weapon, nor would it be able to penetrate me or slice through me. Cast aside this woman. Forget about her and go wherever you came from.
Here Viradha says that he cannot be killed or harmed by any kind of weapon. But in the next Paragraph, we see that Rama's arrow penetrated Viradha's body and he fell down to the ground.
Tufted with peacock feathers and like fire, they penetrated Viradha’s body and smeared with blood, fell down on the ground.
Later both Rama and Lakshmana severed the arms of Viradha with their arrows.
Soumitri severed the left arm of that terrible one. Rama swiftly severed the rakshasa’s right arm. With his arms severed, the rakshasa quickly fainted and fell down on the ground like a cloud, resembling a mountain shattered by the vajra.
If Viradha had a boon that no weapon can harm him, then how did Rama and Lakshmana severed the arms of Viradha with their arrows?