Hyperbole. These plants are mildly toxic, but so are most plants. Unless you have an herbivorous lizard they will be perfectly safe.
Dieffenbachia causes inflammation to mucus membranes at worst. The LD50 for the juice of the plant is 160 mL/kg, meaning an adult basilisk would have to eat a large amount of foliage before a serious medical condition developed. This might be an issue with an herbivorous lizard, but not with a basilisk. The plant is also pretty tough; it's not as though there will be Dieffenbachia juice flying all over the cage, even with a big active lizard.
The case with Spathiphyllum is similar, but it is even less dangerous. The plant can cause mucus membrane inflammation and vomiting if ingested. By the way, this is true for all Araceae, including pothos, Philodendron, and Monstera, and for many other houseplants, including Ficus and Dracaena/Sanseveria (now considered the same genus by some botanists).