Q.Firestick is a poisonous plant
Firestick is a horrible plant. My neighbor planted it in a planter outside of my condo and my phone fell into the bush. I had a milky sap on my hand and then intense burning followed by swelling of my hand, arm and sharp pain in my spine and swelling of my joints. A few days later swelling of the back of my head- my brain! This a toxic plant.
We are sorry you had such an incidence and hope you have recovered.
Yes, the sap in a Pencil Cactus does contain toxins.
The article below has information on this and recommendations that you avoid exposure.
https://www.gardeningknowhow.com/ornamental/cacti-succulents/pencil-cactus/care-pencil-cactus.htm