How to interface MPU9250 and NodeMcu?
The error you're reporting is coming from your call to PubNub.publish(). You could have diagnosed the problem by taking outputting and inspecting what you were passing to it.

Your line:

PubNonSubClient *pclient = PubNub.publish(pubchannel, "String(IMU.getAccelX_mss())");


is not going to work. You're sending the string "String(IMU.getAccelX_mss())" to PubNub rather than the value of IMU.getAccelX_mss() as a String. Take the quotes off it:

PubNonSubClient *pclient = PubNub.publish(pubchannel, String(IMU.getAccelX_mss()));


If for some reason the number has to be returned as a string, the code would look like:

PubNonSubClient *pclient = PubNub.publish(pubchannel, "\"" + String(IMU.getAccelX_mss()) + "\"");