How can we find the largest incircle (not sure if it is still called incircle) tangent to a given point on a side of a polygon? Instead of being tangent to all sides of the polygon, it will be tangent to at least two sides.
Since the centre of the target circle is on the blue line (perpendicular to the polygon's side at point $P$), we can test the possible circles to find the largest one.
However, this is a trial and error approach. I look for a mathematical solution.

Express the line at $P$ perpendicular to its side as the curve $$\gamma : t \mapsto P +t\hat n$$ where $\hat n$ is the unit inward pointing normal vector to the side.
There are two ways the circle can be limited. As shown, it could be tangent to another side. But also, if that inward pointing vertex were lower, the increasing circle might run into the vertex before it became tangent to any side. So calculate:
Among all the values for vertices and non-discarded sides, the smallest $t$ will be the circle you want.