This is important.
When you start making random changes to your code, it’s usually a sign either that you don’t have the knowledge to debug this problem efficiently, or that you are too tired/unfocused.
Take a break, ask for help, read docs, draw an image, break the cycle!
Indeed!
Don't make random changes to the code "hoping they fix the issue".
If a bug goes away by itself... that's usually BAD! I get nervous when that happens, because I want to know WHY it happened in the first place so I can know why and how to fix it for good.