The problem you illustrate in your example may be due to a null pointer; or you encounter weird behavior because of a non null-terminated char array.
In your small example you construct a char array that may not be null-terminated. I tried it but my compiler (arduino) tends to correct it by accident. Indeed it sees that str2 is like a constant so it puts it in program memory, and nothing in RAM memory. Hence it inializes array with 0. Yet it sees that the 40 cells are not used but the 3 first are simply copied to a String, thus it never creates char str2[40]. Your small code:
char str2[40]
str2[0]='a';
str2[1]='b';
String v (str2);
Serial.println(v);
is usually converted ( / optimized) by the compiler as:
String v ("ab"); // note that "ab" is null-terminated
Serial.println(v);
or:
Serial.println("ab");
Note that that tranformation is an example; the compiler will do other assumptions depending of what is written around.
I dont know exactly what you are doing in your program elsewhere, but I think you can do all with the arduino String class. For instance your main example should be something like that:
String dataStr("deb,nonce,end");
int ind = dataStr.indexOf("nonce");
String result = dataStr.substring(ind);
Serial.println(result);
I am pretty sure you should not used old c string library; they are complicated to use and very dangerous. For instance strncpy is mostly useless, it gives you nothing more than strcpy. In strncpy(nonceChar, pch, sizeof(nonceChar)); if pch is too long, nonceChar wont be null-terminated ! In fact you could use strlcpy instead (it is available in my arduino linux v1.6.9 compiler).
Also you should check that strstr does not returns NULL pointer. Or better: use indexOf, and check that it does not return -1.