Prayuth's warning was an apparent reaction to charges that his government has done too little to acquire adequate supplies of vaccines.
If a minister is found guilty of violating ethical standards, the official is to be disqualified and forced to step down.
The Constitutional Court will rule on a complaint brought by Pheu Thai Party that Prayuth has broken the law by continuing to live in his military residence after he retired as army commander in 2014.
The five are part of the student-led movement that has been campaigning for PM Prayuth Chan-ocha and his government to step down and the monarchy be reformed to make it more accountable.
The rally was called by a group that calls itself "Bad Students," mocking their status as rebels against traditional school rules and authorities.
The rallies were called Saturday night after Prime Minister Prayuth Chan-ocha ignored the protesters’ deadline to step down.
The protesters charge that Prayuth, who as army commander led a 2014 coup that toppled an elected government, was returned to power unfairly last year.