I followed the argument given in the answers for this question to find the expected number of misses in a sequence of coin-tosses with success probability $p$. The stopping condition for tossing is either until the $k^{th}$ consecutive miss or until the number of rounds reach $n$, whichever comes first. We can consider tail as a miss and head as hit.
The question in the link differs from my question. In my question stopping happens only when $k$ consecutive miss happens or rounds reach $n$. In the linked question stopping happens when $k$ miss happens.
The probability that $k^{th}$ consecutive miss happen at $i^{th}$ trial can not be simply represent in terms of $i$ and $k$ as the number of hits or misses before the start of the sub-sequence of $k$-consecutive miss is still unknown. There can be many misses and hits before the start of the sub-sequence which results in stopping. Similarly there can be unknown number of misses or hits before reaching the end of round ($n$).
Is it even possible to represent this number in a closed form ? Any help and suggestions ?
Consider first an auxilary problem. In how many ways can we arrange $b$ black balls and $w$ white balls so that every sequence of black balls is shorter than $B$?
The problem is equivalent to that of placing $b$ balls into $w+1$ bins of the capacity $B-1$ balls each. The problem has very well-known solution: $$ N(w,b,B)=\sum_{i\ge0}(-1)^i\binom{w+1}i\binom{b+w-Bi}w,\tag1 $$ with the convention $\binom nk=0$ for $n<0$.
Using this one obtains the following expression for the expected number of rounds in your problem: $$\sum_{i=0}^n n\,N(i,n-i,k)p^i(1-p)^{n-i}+\sum_{l=k}^n l\,\sum_{i=0}^{l-k} N(i-1,l-k-i,k)p^i(1-p)^{l-i},\tag2$$ where the first term accounts for the events where no $k$-row of misses happens until reaching the $n$-th round, whereas the second term accounts for the events where $l-k-1$ rounds ($k+1\le l\le n$) with no $k$-row of misses is followed by a single hit and the $k$-row of misses ($i$ in both sums counts the number of hits). To incorporate into the second sum the event with no hit (pure $k$-row of misses) we redefine $N$ for the case $w=-1,b=0$: $$N(-1,0,B)=1. $$