It seems that Adobe has changed the way this works with Photoshop CC. In prior versions the newLevels() function returns a new Action Descriptor that contains the level settings the user entered into the levels dialog. In Photoshop CC it returns the Action Descriptor created by the function. It does not cause an error because the descriptor has the required info to make a new levels adjustment layer using the default settings.
I don't see an easy way around this change. The best I have been able to come up with is to let the user create the new levels adjustment layer. Then get the settings from that layer and store them in an .alv file. The script can then create a new levels adjustment layer and apply the .alv file. I have not found an easy way to use the current settings directly to make a new layer and the temp .alv file in required for this approach. I think it would be possible to create a function that converts the raw data in the stringIDToTypeID('legacyContentData') key to an Action Descriptor that can be used to make a new layer. That function would be much easier to create if it only had to support the RGB color mode. Creating such a function would eliminate the need for the temp .alv file.
If the script is designed to work in a single session you could dupe the adjustment layer with the user's settings to a new document( or leave the document that contains the layer open ) and dupe that layer to other documents as needed. That method should work with most versions including CC.