C++ string tokenizing without streams, with certain conditions
Well, it seems to do what you want. But, we can do better.

Review:


Avoid dynamic allocation where possible.

string backToBackDelim;
backToBackDelim += delimiter;
backToBackDelim += delimiter;
auto res2 = rawInput.find(backToBackDelim)


becomes

const char backToBackDelim[] = {delimiter, delimiter};
auto res2 = rawInput.find(backToBackDelim, 0, 2)

Don't pass std::string by constant reference unless you depend on the terminator. Pass a view by value instead, specifically C++17 std::string_view. It is more flexible and tends to be more efficient.
An empty line directly after the prototype is curious. Either remove it, or move the opening brace { for the function there.
Define your variables in the smallest scope you can, and invest in good names. What is res / res2, and why do you initialize it all the way up there, and only use it the once down here?
You know what, eliminate it completely, it's bloat.
Choosing good names should also be applied to the function itself. Yours seems to be a placeholder.
Consider marking things const to ease comprehension. No Need to search for possible sites of modification then. That is, if having that extra-variable actually pays for itself with clarity.
You have a bunch of conditions under which you error out. The curious Thing is that you manually duplicated the handling block. Consider merging the conditions so you only need it once.
Don't use else if control-flow doesn't resume after the code-block anyway. Less indentation is better.
You know .substr() will adjust the second argument, if provided, to not leave the string? So, don't try so hard in your last call.


Re-Design:

Mull over your spec. And now try to simplify it. Doing so leads to a simpler, more efficient design, which is optimized for legal input:


Too large or empty => illegal.
Tokenize.
Empty token => illegal.


Rewrite:

bool GcodeParser::tokenize_input_refactored(std::string_view s) {
    // Consider adding here: tokensVec.clear();
    if (auto pos = size(s); pos &amp;&amp; pos &lt;= maxCharAmount) {
        while ((pos = s.find(delimiter))) {
            tokensVec.push_back(s.substr(0, pos));
            if (pos == std::string_view::npos)
                return true;
            s = s.substr(pos + 1);
        }
        tokensVec.clear();
    }
    tokensVec.push_back("INVALID_COMMAND!");
    return false;
}