[proofplan]
We construct the left Kan extension directly from the stated comma-category colimits; no separate functoriality hypothesis is needed because the universal property of each colimit supplies the maps induced by morphisms $h:d\to d'$ in $\mathcal D$. The unit is obtained from the distinguished object $(c,\operatorname{id}_{K(c)})$ of $(K\downarrow K(c))$, and the universal property of the colimit identifies natural transformations $L\to G$ with natural transformations $F\to G\circ K$. The right Kan extension is constructed by the corresponding limit argument, with the naturality and recovery checks verified by comparing all limiting projections.
[/proofplan]
[step:Build the functor from the comma-category colimits]
For each object $d\in\mathcal D$, define
\begin{align*}
L(d) := \operatorname{colim}_{(c,u)\in(K\downarrow d)} F(c).
\end{align*}
Let
\begin{align*}
\lambda^d_{(c,u)}:F(c)\to L(d)
\end{align*}
denote the colimit cocone map indexed by the object $(c,u)$ of $(K\downarrow d)$. Define the projection functor
\begin{align*}
\pi^L_d:(K\downarrow d)&\to\mathcal C \\
(c,u)&\mapsto c \\
\alpha&\mapsto\alpha .
\end{align*}
Let $h:d\to d'$ be a morphism in $\mathcal D$. Define a functor
\begin{align*}
h_*:(K\downarrow d)&\to(K\downarrow d') \\
(c,u)&\mapsto(c,h\circ u) \\
\alpha&\mapsto\alpha .
\end{align*}
This is well-defined because if $\alpha:(c,u)\to(c',u')$ in $(K\downarrow d)$, then $u'\circ K(\alpha)=u$, hence
\begin{align*}
(h\circ u')\circ K(\alpha)=h\circ u.
\end{align*}
Thus $\alpha:(c,h\circ u)\to(c',h\circ u')$ is a morphism in $(K\downarrow d')$.
The family
\begin{align*}
\lambda^{d'}_{h_*(c,u)}=\lambda^{d'}_{(c,h\circ u)}:F(c)\to L(d')
\end{align*}
is a cocone over the diagram $F\circ \pi^L_d:(K\downarrow d)\to\mathcal E$. By the universal property of the [colimit](/page/Colimit) $L(d)$, there is a unique morphism
\begin{align*}
L(h):L(d)\to L(d')
\end{align*}
such that, for every object $(c,u)$ of $(K\downarrow d)$,
\begin{align*}
L(h)\circ \lambda^d_{(c,u)}=\lambda^{d'}_{(c,h\circ u)}.
\end{align*}
The uniqueness clause implies $L(\operatorname{id}_d)=\operatorname{id}_{L(d)}$ and $L(h'\circ h)=L(h')\circ L(h)$, since both sides have the same composites with every colimit cocone map $\lambda^d_{(c,u)}$. Therefore $L:\mathcal D\to\mathcal E$ is a functor.
[/step]
[step:Define the unit using the identity arrow in the comma category]
For each object $c\in\mathcal C$, the pair
\begin{align*}
(c,\operatorname{id}_{K(c)})
\end{align*}
is an object of $(K\downarrow K(c))$. Define
\begin{align*}
\eta_c:F(c)\to L(K(c))
\end{align*}
by
\begin{align*}
\eta_c:=\lambda^{K(c)}_{(c,\operatorname{id}_{K(c)})}.
\end{align*}
We verify that $\eta:F\to L\circ K$ is natural. Let $\alpha:c\to c'$ be a morphism in $\mathcal C$. In $(K\downarrow K(c'))$, the morphism $\alpha:c\to c'$ gives
\begin{align*}
(c,K(\alpha))\to(c',\operatorname{id}_{K(c')})
\end{align*}
because
\begin{align*}
\operatorname{id}_{K(c')}\circ K(\alpha)=K(\alpha).
\end{align*}
Hence the colimit cocone relation gives
\begin{align*}
\lambda^{K(c')}_{(c',\operatorname{id}_{K(c')})}\circ F(\alpha)
=
\lambda^{K(c')}_{(c,K(\alpha))}.
\end{align*}
By the definition of $L(K(\alpha))$ in the previous step,
\begin{align*}
L(K(\alpha))\circ \lambda^{K(c)}_{(c,\operatorname{id}_{K(c)})}
=
\lambda^{K(c')}_{(c,K(\alpha))}.
\end{align*}
Combining the last two identities gives
\begin{align*}
(LK)(\alpha)\circ \eta_c=\eta_{c'}\circ F(\alpha),
\end{align*}
so $\eta:F\to L\circ K$ is a natural transformation.
[/step]
[step:Identify maps out of the constructed functor with natural transformations out of $F$]
Let $G:\mathcal D\to\mathcal E$ be a functor. For functors $A,B:\mathcal X\to\mathcal E$ with common domain $\mathcal X$, let $\operatorname{Nat}(A,B)$ denote the set of natural transformations from $A$ to $B$. We prove that composition with $\eta$ gives a bijection
\begin{align*}
\operatorname{Nat}(L,G)\to\operatorname{Nat}(F,G\circ K),
\qquad
\beta\mapsto(\beta K)\circ\eta .
\end{align*}
First let $\beta:L\to G$ be a natural transformation. Then
\begin{align*}
((\beta K)\circ\eta)_c=\beta_{K(c)}\circ\eta_c:F(c)\to G(K(c))
\end{align*}
defines a natural transformation $F\to G\circ K$ by naturality of $\beta$ and $\eta$.
Conversely, let $\theta:F\to G\circ K$ be a natural transformation. For each object $d\in\mathcal D$ and each object $(c,u)$ of $(K\downarrow d)$, define
\begin{align*}
\gamma^d_{(c,u)}:F(c)\to G(d)
\end{align*}
by
\begin{align*}
\gamma^d_{(c,u)}:=G(u)\circ\theta_c.
\end{align*}
This family is a cocone over $F\circ\pi_d$. Indeed, if $\alpha:(c,u)\to(c',u')$ is a morphism in $(K\downarrow d)$, then $u'\circ K(\alpha)=u$, and naturality of $\theta$ gives
\begin{align*}
G(K(\alpha))\circ\theta_c=\theta_{c'}\circ F(\alpha).
\end{align*}
Therefore
\begin{align*}
\gamma^d_{(c',u')}\circ F(\alpha)
&=G(u')\circ\theta_{c'}\circ F(\alpha)\\
&=G(u')\circ G(K(\alpha))\circ\theta_c\\
&=G(u'\circ K(\alpha))\circ\theta_c\\
&=G(u)\circ\theta_c\\
&=\gamma^d_{(c,u)}.
\end{align*}
By the universal property of $L(d)$, there is a unique morphism
\begin{align*}
\widehat{\theta}_d:L(d)\to G(d)
\end{align*}
such that
\begin{align*}
\widehat{\theta}_d\circ\lambda^d_{(c,u)}=G(u)\circ\theta_c
\end{align*}
for every $(c,u)\in(K\downarrow d)$.
The morphisms $\widehat{\theta}_d$ are natural in $d$. For $h:d\to d'$ in $\mathcal D$, both morphisms
\begin{align*}
G(h)\circ\widehat{\theta}_d,\qquad \widehat{\theta}_{d'}\circ L(h):L(d)\to G(d')
\end{align*}
have the same composite with every $\lambda^d_{(c,u)}$, since
\begin{align*}
G(h)\circ\widehat{\theta}_d\circ\lambda^d_{(c,u)}
&=G(h)\circ G(u)\circ\theta_c\\
&=G(h\circ u)\circ\theta_c,
\end{align*}
while
\begin{align*}
\widehat{\theta}_{d'}\circ L(h)\circ\lambda^d_{(c,u)}
&=\widehat{\theta}_{d'}\circ\lambda^{d'}_{(c,h\circ u)}\\
&=G(h\circ u)\circ\theta_c.
\end{align*}
The uniqueness part of the colimit universal property gives
\begin{align*}
G(h)\circ\widehat{\theta}_d=\widehat{\theta}_{d'}\circ L(h),
\end{align*}
so $\widehat{\theta}:L\to G$ is a natural transformation.
Finally,
\begin{align*}
\widehat{\theta}_{K(c)}\circ\eta_c
&=\widehat{\theta}_{K(c)}\circ\lambda^{K(c)}_{(c,\operatorname{id}_{K(c)})}\\
&=G(\operatorname{id}_{K(c)})\circ\theta_c\\
&=\theta_c.
\end{align*}
Thus the construction sends $\theta$ back to a natural transformation whose composite with $\eta$ is $\theta$. Conversely, if $\beta:L\to G$ is given and $\theta=(\beta K)\circ\eta$, then for every $(c,u)\in(K\downarrow d)$, naturality of $\beta$ for $u:K(c)\to d$ gives
\begin{align*}
\beta_d\circ L(u)\circ\eta_c=G(u)\circ\beta_{K(c)}\circ\eta_c.
\end{align*}
Since $L(u)\circ\eta_c=\lambda^d_{(c,u)}$, this says
\begin{align*}
\beta_d\circ\lambda^d_{(c,u)}=G(u)\circ\theta_c.
\end{align*}
By uniqueness in the definition of $\widehat{\theta}_d$, we get $\widehat{\theta}_d=\beta_d$ for every $d$. Hence the displayed map on natural transformation sets is bijective, and $(L,\eta)$ is a [left Kan extension](/page/Left%20Kan%20Extension) of $F$ along $K$.
[/step]
[step:Construct the right Kan extension by the dual limit argument]
For each object $d\in\mathcal D$, define
\begin{align*}
R(d):=\lim_{(c,u)\in(d\downarrow K)} F(c).
\end{align*}
Let
\begin{align*}
\rho^d_{(c,u)}:R(d)\to F(c)
\end{align*}
denote the limiting cone map indexed by the object $(c,u)$ of $(d\downarrow K)$. Define the projection functor
\begin{align*}
\pi^R_d:(d\downarrow K)&\to\mathcal C \\
(c,u)&\mapsto c \\
\alpha&\mapsto\alpha .
\end{align*}
Let $h:d\to d'$ be a morphism in $\mathcal D$. Define a functor
\begin{align*}
h^*:(d'\downarrow K)&\to(d\downarrow K)\\
(c,u)&\mapsto(c,u\circ h)\\
\alpha&\mapsto\alpha .
\end{align*}
This is well-defined because if $\alpha:(c,u)\to(c',u')$ in $(d'\downarrow K)$, then $K(\alpha)\circ u=u'$, and therefore
\begin{align*}
K(\alpha)\circ(u\circ h)=u'\circ h.
\end{align*}
Thus $\alpha:(c,u\circ h)\to(c',u'\circ h)$ is a morphism in $(d\downarrow K)$.
The family
\begin{align*}
\rho^d_{h^*(c,u)}=\rho^d_{(c,u\circ h)}:R(d)\to F(c)
\end{align*}
is a cone over the diagram $F\circ\pi^R_{d'}:(d'\downarrow K)\to\mathcal E$. By the universal property of the [limit](/page/Limit) $R(d')$, there is a unique morphism
\begin{align*}
R(h):R(d)\to R(d')
\end{align*}
such that, for every object $(c,u)$ of $(d'\downarrow K)$,
\begin{align*}
\rho^{d'}_{(c,u)}\circ R(h)=\rho^d_{(c,u\circ h)}.
\end{align*}
Uniqueness gives $R(\operatorname{id}_d)=\operatorname{id}_{R(d)}$ and $R(h'\circ h)=R(h')\circ R(h)$, so $R:\mathcal D\to\mathcal E$ is a functor.
For each $c\in\mathcal C$, define
\begin{align*}
\varepsilon_c:R(K(c))\to F(c)
\end{align*}
by
\begin{align*}
\varepsilon_c:=\rho^{K(c)}_{(c,\operatorname{id}_{K(c)})}.
\end{align*}
We verify that $\varepsilon:R\circ K\to F$ is natural. Let $\alpha:c\to c'$ be a morphism in $\mathcal C$. In $(K(c)\downarrow K)$, the morphism $\alpha:c\to c'$ gives
\begin{align*}
(c,\operatorname{id}_{K(c)})\to(c',K(\alpha))
\end{align*}
because
\begin{align*}
K(\alpha)\circ \operatorname{id}_{K(c)}=K(\alpha).
\end{align*}
Hence the limiting cone relation gives
\begin{align*}
F(\alpha)\circ\rho^{K(c)}_{(c,\operatorname{id}_{K(c)})}
=
\rho^{K(c)}_{(c',K(\alpha))}.
\end{align*}
By the definition of $R(K(\alpha))$, applied to the object $(c',\operatorname{id}_{K(c')})$ of $(K(c')\downarrow K)$, we have
\begin{align*}
\rho^{K(c')}_{(c',\operatorname{id}_{K(c')})}\circ R(K(\alpha))
=
\rho^{K(c)}_{(c',K(\alpha))}.
\end{align*}
Combining the last two identities gives
\begin{align*}
F(\alpha)\circ\varepsilon_c=\varepsilon_{c'}\circ (RK)(\alpha),
\end{align*}
so $\varepsilon:R\circ K\to F$ is a natural transformation.
Now let $G:\mathcal D\to\mathcal E$ be a functor. Composition with $\varepsilon$ defines
\begin{align*}
\operatorname{Nat}(G,R)\to\operatorname{Nat}(G\circ K,F),
\qquad
\beta\mapsto \varepsilon\circ(\beta K).
\end{align*}
Given $\theta:G\circ K\to F$, define for each $d\in\mathcal D$ and each object $(c,u)$ of $(d\downarrow K)$ a morphism
\begin{align*}
\delta^d_{(c,u)}:G(d)\to F(c)
\end{align*}
by
\begin{align*}
\delta^d_{(c,u)}:=\theta_c\circ G(u).
\end{align*}
If $\alpha:(c,u)\to(c',u')$ in $(d\downarrow K)$, then $K(\alpha)\circ u=u'$, and naturality of $\theta$ gives
\begin{align*}
F(\alpha)\circ\theta_c=\theta_{c'}\circ G(K(\alpha)).
\end{align*}
Therefore
\begin{align*}
F(\alpha)\circ\delta^d_{(c,u)}
&=F(\alpha)\circ\theta_c\circ G(u)\\
&=\theta_{c'}\circ G(K(\alpha))\circ G(u)\\
&=\theta_{c'}\circ G(K(\alpha)\circ u)\\
&=\theta_{c'}\circ G(u')\\
&=\delta^d_{(c',u')}.
\end{align*}
Thus $\delta^d$ is a cone from $G(d)$ to $F\circ\pi^R_d$. By the universal property of the [limit](/page/Limit) $R(d)$, there is a unique morphism
\begin{align*}
\widehat{\theta}_d:G(d)\to R(d)
\end{align*}
such that
\begin{align*}
\rho^d_{(c,u)}\circ\widehat{\theta}_d=\theta_c\circ G(u)
\end{align*}
for every $(c,u)\in(d\downarrow K)$.
The morphisms $\widehat{\theta}_d$ are natural in $d$. For $h:d\to d'$ in $\mathcal D$, both morphisms
\begin{align*}
R(h)\circ\widehat{\theta}_d,
\qquad
\widehat{\theta}_{d'}\circ G(h):G(d)\to R(d')
\end{align*}
have the same composite with every limiting projection $\rho^{d'}_{(c,u)}$, where $(c,u)$ is an object of $(d'\downarrow K)$. Indeed,
\begin{align*}
\rho^{d'}_{(c,u)}\circ R(h)\circ\widehat{\theta}_d
&=\rho^d_{(c,u\circ h)}\circ\widehat{\theta}_d\\
&=\theta_c\circ G(u\circ h)\\
&=\theta_c\circ G(u)\circ G(h),
\end{align*}
while
\begin{align*}
\rho^{d'}_{(c,u)}\circ\widehat{\theta}_{d'}\circ G(h)
&=\theta_c\circ G(u)\circ G(h).
\end{align*}
The uniqueness part of the limit universal property gives
\begin{align*}
R(h)\circ\widehat{\theta}_d=\widehat{\theta}_{d'}\circ G(h),
\end{align*}
so $\widehat{\theta}:G\to R$ is a natural transformation. Moreover,
\begin{align*}
\varepsilon_c\circ\widehat{\theta}_{K(c)}
&=\rho^{K(c)}_{(c,\operatorname{id}_{K(c)})}\circ\widehat{\theta}_{K(c)}\\
&=\theta_c\circ G(\operatorname{id}_{K(c)})\\
&=\theta_c.
\end{align*}
Conversely, let $\beta:G\to R$ be a natural transformation and define $\theta:=\varepsilon\circ(\beta K)$. For each object $d\in\mathcal D$ and each object $(c,u)$ of $(d\downarrow K)$, naturality of $\beta$ for $u:d\to K(c)$ gives
\begin{align*}
R(u)\circ\beta_d=\beta_{K(c)}\circ G(u).
\end{align*}
Composing with $\varepsilon_c=\rho^{K(c)}_{(c,\operatorname{id}_{K(c)})}$ and using the defining property of $R(u)$ gives
\begin{align*}
\rho^d_{(c,u)}\circ\beta_d
&=\rho^{K(c)}_{(c,\operatorname{id}_{K(c)})}\circ R(u)\circ\beta_d\\
&=\varepsilon_c\circ\beta_{K(c)}\circ G(u)\\
&=\theta_c\circ G(u).
\end{align*}
Thus $\beta_d$ has the same composites with every projection $\rho^d_{(c,u)}$ as the morphism constructed from $\theta$. By uniqueness in the definition of $\widehat{\theta}_d$, we get $\widehat{\theta}_d=\beta_d$ for every $d$. Hence
\begin{align*}
\operatorname{Nat}(G,R)\cong\operatorname{Nat}(G\circ K,F)
\end{align*}
naturally in $G$, so $(R,\varepsilon)$ is a [right Kan extension](/page/Right%20Kan%20Extension) of $F$ along $K$.
[/step]
[step:Extract the pointwise formulas]
The left construction gives a left Kan extension $L=\operatorname{Lan}_K F$ with
\begin{align*}
L(d)=\operatorname{colim}_{(c,u)\in(K\downarrow d)} F(c)
\end{align*}
for every $d\in\mathcal D$. Therefore
\begin{align*}
(\operatorname{Lan}_K F)(d)\cong \operatorname{colim}_{(c,u)\in(K\downarrow d)} F(c)
\end{align*}
naturally in $d$.
The right construction gives a right Kan extension $R=\operatorname{Ran}_K F$ with
\begin{align*}
R(d)=\lim_{(c,u)\in(d\downarrow K)} F(c)
\end{align*}
for every $d\in\mathcal D$. Therefore
\begin{align*}
(\operatorname{Ran}_K F)(d)\cong \lim_{(c,u)\in(d\downarrow K)} F(c)
\end{align*}
naturally in $d$. This proves both pointwise formulas.
[/step]