The stem fits into a slot made with a 3/8 inch end mill:
You move the cutter by the length of the sensor (10.0 mm will work) to make the slot. In practical terms, drill a hole at the midpoint, insert the cutter, then move ±5.0 mm from the center:
A bead of epoxy around the stem on the bottom of the panel should hold it in place forevermore.
The rectangular inner hole came out a tight push fit for the TCRT5000 sensor, so I didn’t bother gluing it in place and, surprisingly, it survived the day unscathed!
The OpenSCAD source code as a GitHub Gist: