Your conception of the equilibrium constant is flawed. $K_\mathrm{p}$ is preferably used when the reaction only contains gaseous and solid components whereas $K_\mathrm{c}$ is used primarily for a reaction taking place in water.
In reality, however, both of these equilibrium constants are special cases of equilibrium. This is because in the actual scenario, what we use to calculate the equilibrium constant is a concept known as activity.
$K_\mathrm{p}$ and $K_\mathrm{c}$ are said to be special cases of $K$ since, in $K_\mathrm{p}$, the activity is expressed in terms of the partial pressure of the components and in $K_\mathrm{c}$, the activity is expressed in terms of concentrations of the products and reactants.
In case of reaction as stated above:
$$\ce{A(aq) + B(aq) <=> C(g) + D(aq)}$$
The equilibrium constant would be expressed as follows:
$$K = \frac{a_\mathrm{C}\cdot a_\mathrm{D}}{a_\mathrm{A}\cdot a_\mathrm{B}}$$
Now, for the aqueous components, the activity is expressed in terms of their concentration in the solvent. For the gaseous component, we express it in terms of its partial pressure. Substituting these conditions, we get:
$$K = \frac{P_\mathrm{C}[\mathrm{D}]}{[\mathrm{A}][\mathrm{B}]}$$
An example of where this is used is in electrochemistry.
A galvanic cell may be made which has a heterogenous reaction in which solid, aqueous and gaseous components may be given.
The Nernst equation used to calculate the EMF of such a cell is given as:
$$E_\mathrm{cell} = E^\circ_\mathrm{cell}-\frac{2.303RT}{nF}\log_{10}Q$$
Here, $Q$ is the reaction quotient. Using this, we calculate the EMF taking all the activities into consideration.
Note: The activity of a solid or the solvent is taken to be $1$ in such cases.