You have two problems.
1) Something is wrong with the code. You need to fix it.
2) You do not know how to understand what “something” is.
The solution to the first problem is related to the solution to the second problem. You need to learn how to debug the program you just wrote.
You already tested it and got a result that you called meaningless. This is a good first step. Now break it even further. Choose a simple problem in this area that you can solve with a pencil and paper; do this, and then see how your algorithm solves the same problem in the debugger by checking every step along the way. Listen to quiet doubts. . When there is something that looks slightly unexpected or unexpected, stop what you are doing and research the problem until you understand whether things are working correctly or not. In the end, you will find a step where everything is not as it should be, and that where the error is.
Yes, it is tiring. When you find a mistake and fix it, stop and think about what made you write the error in the first place, and find out how not to write that error again.
UPDATE:
Re: your last comments.
Apology accepted. Now calm down. You will never find this mistake if you handle it. Your brain will not allow you. People in a panicky, processed state lose their ability to reason. That is why fire opens doors outward; people fleeing a burning building literally will not stop thinking: "I push this door and I don’t open it, maybe I should try to pull it." They just get tense. I suspect you click more.
Debugging requires rationality and careful attention to small details. If you all figured out this problem, then it will exit the window, and it will only get worse. Take it from the one who was there. We were all there. This is a very unpleasant thing that caused an error in your own program, which you then cannot find.
The reason no one helps you is because ... well, let me list a set of prerequisites that must be met for me to help you with more than vague platitudes and suggestions on how to focus my efforts debugging:
1) I need to learn something about simulation of 3d physics. I had a pretty decent understanding of the differential equations of simple Newtonian mechanics in 1992, but I have not used it since. And the spring damped driving equation is quite different from the solid collision equations. If I spend a couple of weeks looking through my notes, I can return the math, but this is unrealistic. You need someone who is deeply familiar with 3D collision modeling.
2) I must be able to read and understand your code, hundreds of lines of code written by someone other than me to solve a problem that I am not familiar with. Even worse, a hundred lines of this code are commented out. What for? Is this relevant? Is there a mistake there? Moreover, I need to be able to read and understand the code without running it in the debugger. Hell, I can't even compile this code. It depends on libraries that I don't have.
And even worse, one of these libraries may contain an error. As far as I know, the error is a typo in some code that calculates a normal place somewhere that you did not show us. The code shown may be perfect.
3) I need to have free time to work on someone’s serious problem; the problem is that the person who wrote the code and understands physics is not moving forward.
All these are requirements; if any of them is missing, the reader cannot help you effectively. You ask people you don’t know to help you find a black cat in a dark warehouse at midnight without a flashlight - a cat that might not even be there. It is not surprising that you get few participants. Of the 74 users who read your question, how many of them meet all three requirements? I have not met any of them.
If you need help on this site, submit an easier problem. Clarify the problem before the problem, which requires less specialized knowledge in physics and modeling algorithms and has only the appropriate code, preferably code that can be compiled and run.