The third argument tells fromArray() to set the primary key. It defaults to false and text is the primary key, so it’s not being set.
You could also have left the text member out of the array used this just before the save() call:
$menu->set('text', 'myapp.configuration');
FYI, the second argument (empty string here) holds an optional prefix to remove, the fourth argument tells fromArray() to use the raw values from your array to set the fields rather than calling the object’s set() method for each one.