Heated plastic can release styrenes. No, they are not good for health. If you are talking about heating up a plastic cap...it is not a large volume of plastic, so it might not be all that bad.
I would definitely not linger over it, while doing it...at least have some good ventilation...get the pot of boiling water, put that bottle in upside down and leave the room. Or, better yet, put the whole thing outside until it is time to check on it.
I don't know the range here...when it produces enough styrenes or other chemicals to be dangerous.
Personally, I would just throw out the bottle.
Generally, there are a lot of DIY ideas that seem good and seem to save money, but are actually not all that safe.
My father was experimenting endlessly. He had an engineering background.
He once made a set of dentures for himself.
I said to him..."Dad, did you use medical grade porcelain?" He looked at me like I was nuts. Then, I explained, that materials can have different grades and if something is not "food grade" or "medical grade" ----- it very well might have toxic materials in it.
Unless you have real mastery in chemistry and such...just be careful re DIY projects...