Yes. The system is outright dysfunctional particularly for programming.
There is a common ideal of making your programming code very readable. It amounts to following a sense of best practices and naming sense, such as making any kind of variable names self-explanatory.
The university teaches this (if you have programming classes). Subsequently the plagiarism checker will report you for similarities in your code and existing code on the web. The sole leeway the university permits, is that it will allow you to plagiarize the universities resources.
Quite frankly, when you follow the taught optimal structure and common style, that includes common structures, that are termed self explanatory, in that case it is highly likely you will end up guilty of plagiarism. Most people do not, because they follow the universities code and it is reflected in their programming.
I quite frankly have always had to take my own code and scan it against a plagiarism system before submitting it, often having to make bad variable names and structure modifications just to bypass the system, despite writing original code.
In some cases, there is a statement to use references which avoids plagiarism. In almost all, at least all in mine and those I know of, we are told that we agree to the terms before submission. Which include that we are responsible for any plagiarism and that it is our responsibility to ensure this does not happen even if on accident. The moment there is a court case with this read out, your chances of succeeding are minimal.
No, plagiarism in an academic sense is usually not a criminal offense, particularly as part of a course.