Longest common subsequence of a set of sequences
There may be multiple different ways to upper-bound the running time of an algorithm.

Saying that the running time of an algorithm is $O(m^2 n^4)$ is analogous to saying that the running time is at most $m^2 n^4$ (ok, $c \cdot m^2 n^4$, for some constant $c$).  The keyword there is "at most".  So, think of $O(\cdot)$ as more like $\le $ than like $=$.

I haven't tried to analyze the running time of your specific algorithm, but to make up some numbers, it is possible that the running time could simultaneously be $O(m^2 n^4)$ and it could also be true that the running time is (say) $O(m^2 \ell^4)$ where $\ell$ is the length of the longest subsequence.  I'm totally making up those figures -- don't take them too seriously, as I don't claim they are actually valid running times for your algorithm -- I am just saying that both claims are consistent, i.e., they could both be true, without contradicting each other.

It's analogous to the fact that we could have both $x \le 3$ and $x \le 4$ be true.  Or, we could have both $x \le c^2$ and $x \le d^3$ be true.



Side remark: I haven't looked at your algorithm closely, but it looks suspicious to me. I would be surprised if it is a correct solution for the longest common subsequence problem.