This generally happens when the cooking temperature isn't high enough to soften the potatoes, or they aren't cooked for long enough. This can happen if the boiling water isn't actually boiling, or if your oven temperature is a little off. You may want to calibrate the temperature on your oven using a super inexpensive and handy tool. Another possibility is that you waited too long after cooking to add a sauce (or butter, cream, etc) and the chunks of potato flesh developed a starchy coating. Rule of thumb is to not let cooked potatoes sit for too long without finishing them.