As shown in the figure, let P1,P2,P3,P4,P5 denote respectively the feet of perpendiculars from P to segments AB, BC, AC, BD, AD.

Let M1,M2,M3,M4,M5 be the midpoints of AB, BC, AC, BD, AD respectively. Consider △ABC. Clearly the circumcenter O is the orthocenter of △M1M2M3. By Steiner's theorem, the reflections of line L in M1M2, M2M3, M3M1 must meet at a point K1 on the nine-point circle of △ABC. Consider △ABD, and determine the point K2 by the same method. Since K1,K2 are both independent of the position of P, we will next show that Q lies on the line K1K2, which will establish that the locus of Q is a line.

We first prove: △POC∼△P1M1K1:
(i) Let the reflection of line L in M2M3 be the line EK1. Computing angles:
∠K1M1B=∠EK1M1−∠EFM3=∠EM2M1−∠PFM3=(∠EM2M3+∠M3M2M1)−∠PFM3=(∠OCA+∠CM3M2)−∠PFM3=∠CGB−∠PFM3=∠COF.
Hence we know ∠P1M1K1=∠POC.
(ii) Computing the ratio:
OCM1K1=sin∠K1EM1=sin∠EOF=POP1M1
(since the length OC equals the diameter of the nine-point circle)
(iii) Hence by SAS we know △POC∼△P1M1K1. Similarly we also know: △POB∼△P3M3K1, △POA∼△P2M2K1.
Next we prove: K1 lies on circle c1; computing angles
∠P3K1P1=∠M3K1M1−(∠P3K1M3+∠P1K1M1)=∠CAB−(∠P3K1M1+∠P1K1M1)(since K1 lies on the nine-point circle)=∠CAB−(∠PBO+∠PCO)=(∠OAC+∠OBC)−(∠PBO+∠PCO)=(∠OCA+∠OCB)−(∠PBO+∠PCO)=∠PCP3+∠PBP1=∠PP2P3+∠PP2P1=∠P3P2P1,
which proves that K1 lies on circle c1; similarly K2 lies on circle c2.
We next show that △P1O1O2∼△PCD, where O1,O2 are respectively the centers of c1,c2:
(i) Let the points symmetric to P with respect to O1,O2 be I1,I2 respectively. Then we know that I1,I2 are respectively the isogonal conjugate points of P with respect to △ABC,△ABD. Computing
∠AI1B=180∘−(∠I1AB+∠I1BA)=180∘−(∠PAC+∠PBC)=180∘−(∠APB−∠ACB)=(180∘−∠P2P1P3).
Similarly ∠AI2B=180∘−(∠APB−∠ACB), hence A,B,I1,I2 are concyclic. Also we know: ∠I1BI2=∠CBD.
(ii)
CDO1O2=2CDI1I2=ABI1I2×2CDAB=21sin∠AI1Bsin∠I1BI2×sin∠CBDsin∠ACB=21sin∠AI1Bsin∠ACB=21sin∠P2P1P3sin∠ACB×P2P3P2P3=21PC2O1P1=PCO1P1.
Similarly, CDO1O2=PDO2P2. Hence by SSS we obtain △P1O1O2∼△PCD.
Since △POC∼P1M1K1, △POD∼△P1M1K2, we therefore know that △PCD∼△P1K1K2. Hence
△P1K1K2∼△P1O1O2⟹∠P1O1K1=∠P1O2K2(let this be 2α)
So we obtain: ∠P1QK1+∠P1QK2=α+(180∘−α)=180∘. So the three points K1,Q,K2 are collinear. But K1,K2 are both independent of the position of P, depending only on the line L, so as P moves on L, the locus of the point Q is a line K1K2.