Troubleshooting suggestions

What do you mean by k-rate loops? While-loops? If-statements?

I remember I had a issue with if-statements and k-rate variables at initialization. The if-statement would run even if the condition was not true, thus setting the identifier to a value it was not supposed to be when starting to run the code. The way I fixed this was by using inline if-statements (like this post is showing: LFO on GUI Parameters).

Could it be related to this? Maybe you can prepare a simple .csd where you experience the issue? Atleast record a .gif and post here (using something like ScreenToGif)?