This is the only way I found after struggling for three days. I will post a simpler and purely geometric answer when I found it.
First, we need to prove some theorems before solving this problem.
Theorem A: Consider a point $P$ and a line $l$. $Q$ is a point on line $l$, such that line segment $PQ$ is perpendicular to line $l$. Construct circle $c$ with $P$ as one end of the diameter and an arbitrary point $R$ on line $l$. Then,
1, Circle $c$ will always pass through point $Q$.
2, Locus of an arbitrary point $D$ on the circle $c$ (such that arc $RD$ is making an arbitrary angle $2θ$ at the center $S$ of the circle) is an straight line passing through point $Q$.
Image
Proof:
1, Any point that makes a right angle with diameter of the circle will be incident on the circle. $PQ$ was perpendicular to line $l$, and $R$ lies on line $l$. Hence, $Q$ will be on circle regardless of the position of $R$.
2, As Points $P$ and $Q$ are on same circle, the arc $RD$ will make an angle $θ$ (180-$θ$, when $Q$ is in between $R$ and $D$).
Line segment $RD$ always makes a constant angle $θ$ (180-$θ$, when $Q$ is in between $R$ and $D$) with line $l$. This is the locus of a straight line passing through $Q$ and making an an angle of $θ$ with line $l$.
Check this geogebra link for an interactive model
Lemma A1: Ratios of the lengths $PD$ and $PR$ will remain constant as long as θ remains constant.
Proof:
As the triangle $PDR$ is a right angled triangle, $$PD/PR = cosθ$$
This ratio will remain constant as long as $θ$ remains constant.
Finally to the problem. Now, we can see that the two (semi)circles in the problem belong to the family of circles that are formed by rotating the diameter around point $P$ with other end resting on the line $AB$.
Image link
The diameters of two circles $AP$ and $BP$ with centers $D$ and $E$ are perpendicular.
The angles $ADN'$ and $M"DA$ are represented by $α$ and $β$ respectively.
Lemma B1: The arcs $BN''$ and $M'B$ make angles $\alpha$ and $\beta$ at Center $E$
Proof:
The arc $AN'$ makes an angle of '$\alpha/2$' at point $Q$. [half the angle at center.]
$\angle {N''QB} = \angle AQN' = \alpha/2$
$\angle N''EB = \alpha$
Similarly, $\angle M'EB = \beta$
- This is the converse of the Theorem A2.
Theorem B: Let, points $C,C'$ are midpoints of $MN$ and $M'N'$. The line $CC'$ will pass through $P$, if $\alpha = \beta$.
Let, $PA = 2a; PB = 2b; PM = m; PN = n.$
From Lemma A1,
$PN'' = (2b)cos\alpha/2; PM' = (2b)cos\beta/2; PN' = (2a)cos\alpha/2; PM'' = (2a)cos\beta/2.$
Writing the equation of line passing through points $A$ and $B$ in polar form.
$r(\theta) = sec(\theta - \angle APQ) .PQ$
$r$ = distance from $P$ (origin)
$\theta$ = angle made with $PA$ (x-axis)
$r(\theta) = sec(\theta - \angle PBA) .PQ$ [Similar triangles]
$Let, \angle PBA = \angle B ;\angle BAP = \angle A.$
$r(\theta) = sec(\theta - \angle B) .PQ$
$N$ is obtained when $N''$ slided on the line $N''Q$ by a making an angle of $-\alpha/2$ at $P$.
The corresponding diameter can be found by sliding point $B$ on line $AB$ while rotating $-\alpha/2$
The length of the corresponding diameter is,
$r(\pi/2 - \alpha/2)$ = $sec(\pi/2 - \alpha/2 - \angle B). PQ$
From Lemma A1,
$PN = (PN''. r(\pi/2 - \alpha/2))/r(\pi/2)$
$n = ((2b)cos\alpha/2.sec(\pi/2 - \alpha/2 - \angle B). PQ)/2b$
$n = cos\alpha/2.sec(\alpha/2 - \angle A). PQ$
Similarly,
$m = cos\beta/2.sec(\beta/2 - \angle B). PQ$
Coordinates of $M =(m,0); N = (0,n)$
$C = (m/2,n/2)$
Coordinates of $M'= [(2b)cos\beta/2].(sin\beta/2 , cos\beta/2);$
$N'=[(2a)cos\alpha/2].(cos\alpha/2, sin\alpha/2)$
$C' = \frac{M'+N'}{2}$
For $P,C,C'$ be collinear, slope of $CP$ must be equal to slope of $C'P$
$\frac{cos\alpha/2.sec(\alpha/2 - \angle A)}{cos\beta/2.sec(\beta/2 - \angle B)} = \frac{bcos^2(\beta/2) + acos\alpha/2 sin\alpha/2}{acos\beta/2 sin\beta/2 + acos^2(\alpha/2)}$
We know that $\angle A + \angle B = \pi/2$ and $tan\angle B = \frac{a}{b}$
Therefore, $\frac{(cos\alpha/2)(bcos\beta/2 + asin\beta/2)}{(cos\beta/2)(acos\alpha/2 + bsin\alpha/2)} = \frac{bcos^2(\beta/2) + acos\alpha/2 sin\alpha/2}{acos\beta/2 sin\beta/2 + acos^2(\alpha/2)}$
It can be seen that the equality is true for $\alpha=\beta$
- For more rigorous solution, we must form the polynomial of powers of $a,b$ and equate all coefficients to zero.
Corollary B1: $P,C,C'$ will be collinear if $$\frac{2a-m}{m.a^2} = \frac{2b-n}{n.b^2}$$
Proof: $PQ = 2b.cos\angle B = 2a.cos\angle A$
$m = cos\beta/2.sec(\beta/2 - \angle B). PQ$
$tan\beta/2 = \frac{2b}{m} - cot\angle B$
$tan\beta/2 = \frac{b.(2a-m)}{m.a}$
Similarly, $tan\alpha/2 = \frac{a.(2b-m)}{n.b}$
As $\alpha = \beta$ from Theorem B, Right Hand Side of both equations are equal.
Equating Left Hand Sides of both equations,
$$\frac{2a-m}{m.a^2} = \frac{2b-n}{n.b^2}$$