Component cannot be placed correctly on the ceiling

Hello, I wrote a script, but I don’t know what went wrong. I can’t place the component correctly at the point position on the ceiling, and it only appears in a partial position. Can anyone help me? I would be very grateful.



I have solved only part of the problem, but there is an error message in familyinstance.byface,Warning: FamilyInstance.ByFace job failed.
Reference direction is parallel to face normal at insertion point.
Parameter name: multiple
Please, how can I solve it?

![螢幕擷取畫面 2024-01-23 080144|690x308]