When I add or remove some paragraph in other section of the overleaf project, the algorithm2e algorithm body collapses intermittently as shown in the attached image below.

Following is a sample code to generate the error:
\documentclass{article}
\usepackage[utf8]{inputenc}
\title{algo_issue}
\date{July 2022}
\usepackage{subcaption} %a
\usepackage[ruled,vlined,linesnumbered]{algorithm2e} %a
\usepackage{amsmath} % a
\usepackage{amsfonts} % a
\usepackage{amssymb} % a
\usepackage{amsthm} % a 2
\usepackage{multicol} % a
\usepackage{multirow} % a
% \SetKwInput{KwGlobal}{Global} % Set the Global variables
\SetKwProg{myproc}{procedure}{}{end}
\begin{document}
% \maketitle
\section{Introduction}
Hello, I am trying to create a bug.
It may take some effort
\section{Abc}
this is a sample line.
\section{b}
this is sample
\begin{algorithm*}[!htb] % replaced [t] temporarliy [!htb]
\DontPrintSemicolon
\caption{ this is my caption }
\label{algo:algo1}
\begin{multicols}{2}
% \fontsize{8pt}{6pt}\selectfont
\footnotesize
%\small
\SetAlgoLined
% 1st procedure BEGINS <---------------------------------------------------------------------------
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\columnbreak
\vspace*{5px}
\BlankLine
\myproc{$\mathtt{p2}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\BlankLine
\BlankLine
\myproc{$\mathtt{p1}${ ($a$, $b$, $c$)}}
{
hello
\smallskip
hello
}
\end{multicols}
\end{algorithm*}
\end{document}
I am using 2 column page Please help.


\columnbreakasks it to do so. 3) The document has a 2-col layout. – akhil Jul 26 '22 at 13:52\columnbreakcommand – akhil Jul 26 '22 at 13:53\columnbreakworks inside multicols. I'm almost sure, you can't use it inside an algorithm2e environment. See https://tex.stackexchange.com/search?q=algorithm2e+columnbreak for similar problems, yours included. // Workarounds: 1) Try algoritmicx . 2) Stay with algorithm2e AND split your long algo intentionally into smaller parts. E.g. one could be a series of say 4 calls, and the next 4 algos detail that, leaving your with 5 algos in total, from coarse to fine. // Some people here tried e.g. https://tex.stackexchange.com/questions/18949/algorithm2e-split-over-several-pages . – MS-SPO Jul 26 '22 at 14:29\columnbreak works inside multicols. I'm almost sure, you can't use it inside an algorithm2e environment., I have doubt that as you can see in the sample code, that\columnbreakis used within multicols. Also, I have used it in many other algorithms where this problem of disappearing didn't happen. So\columnbreakis not the real cause of disappearance.Now, even if I remove
– akhil Jul 26 '22 at 15:32\columnbreakI face another issue in which theendtag of a procedure flows to 2nd column instead of being in 1st col.\columnbreakcommand, such that theendtag of last procedure in 1st column does not move to 2nd column. You can remove\columnbreakand check. Any solution to this problem ? – akhil Jul 26 '22 at 15:34