I have a similar issue. How do I raise this UV sensor (GUVB-S11SD) by 3mm or even higher? Light pipes, either glass or plastic, aren't transparent to these wavelengths of light.
It's footprint is 3.5mm × 2.8mm, centered on two 1.3mm × 2.3mm pads separated by 1.7mm. The center-to-center pad distance is exactly 3mm.
I'm only a know-nothing hobbyist, but I would convert the sensor from SMD to through-hole, with at least two male pins (at standard 0.1" = 2.54mm pitch) on the sensor side, and a female header on the board. I know of three ways to do this.
One is to solder a 90-degree two-pin male header (standard 0.1" = 2.54mm pitch) on the sensor directly. It should be doable by hand. If you use through holes on the board, depending on the pin length you use, you can get 3mm – 7mm raise. Note that the pins will be off to one side, not centered with the sensor, and accurate placement can be a bit difficult.
The other is to create a set of tiny boards in a strip or panel, with the sensor on one side, and pads for an SMD header, connector, or wires on the other side, populate and solder them, and then cut each one out. If the UV sensor pokes through the enclosure, the helper board can be used (perhaps with tiny screws) to connect the sensor to the enclosure, and just use wires to the board. The board alone gives a 1.5mm - 1.8mm raise, but since it can be larger than the sensor (say 7mm square), you can then easily use e.g. single through-hole pins (one on each side of the sensor) to raise it as much as you can find long enough pins. You might use three pins for stability, and heatshrink to cover the bare pins between the two boards. Or, for more flexible placement, just use wires between the two boards.
The third is to make your own riser blocks, for example by gluing two layers of one-sided PCB material together, conductive surfaces outwards, in strips; or by casting copper strips in suitable non-acid curing electrically insulating rubber or silicone. Both yield one long riser block you then cut (shear and sand) to the desired lengths.
For proper production, I think the second/middle choice is the most sensible one. But again, I know nothing.