thanks for posting the split code,
but in that form we only can guess what might go wrong.
but for test, to get something run-able, must put in some more minutes and make a MVCE
i show you what i tried and the results.
( as close as possible to your code
but without having that many variables / you not posted the declaration )
String inBuffer;
inBuffer = "158018 70222 149288 44793 12944 94 -96.0 -305.8 129.4 221.9 45.2 1 -1 0 0 0";
//inBuffer = "e 96.0 305.8 129.4 221.9";
char c1 = inBuffer.charAt(0);
if (c1 == 'e') {
float[] errs = float(split(inBuffer, ' '));
println(errs);
} else {
float[] nums = float(split(inBuffer, ' '));
println(nums);
}
/*
[0] 158018.0
[1] 70222.0
[2] 149288.0
[3] 44793.0
[4] 12944.0
[5] 94.0
[6] -96.0
[7] -305.8
[8] 129.4
[9] 221.9
[10] 45.2
[11] 1.0
[12] -1.0
[13] 0.0
[14] 0.0
[15] 0.0
*/
/*
[0] NaN
[1] 96.0
[2] 305.8
[3] 129.4
[4] 221.9
*/
in other words, with the provided 2 lines your problem could not be reproduced here.
to the serial code, is might help to use also the
https://processing.org/reference/trim_.html
on the “inBuffer” to clean it.
also about the inBuffer eval,
do use data only if you sure they exist! as i posted
Trouble with the Serial port read here