I don’t think you’re wrong about the mass noun distinction, but I think you’re wrong in assuming that it is the main factor in determining whether a singular or plural should be used.
Obviously, if the noun in question is a mass noun, there is no way you’re going to use an awkward or even nonexistent plural for this construction; so let’s ignore cases like “I’ve had no food since Monday” completely aside (and be happy for the person speaking that today happens to be a Monday).
In all the other cases, I find both singulars and plurals perfectly natural, but they imply different things. The fact that they are negated does not cancel out the singular/plural distinction entirely. Semantics may make some cases more likely to be singular than plural or vice versa, but that’s very individual to the context and idiomaticity.
In general, I would say that the distinction is:
The singular is used when the sense is that a specific [noun] is negated, or that the [noun] that is negated is expected or implied to be singular itself. “I have had no [singular]” is equivalent to “I have not had a/the [singular]”.
The plural is used when the sense is that the negated [noun] is of unknown number—that is, if it hadn’t been negated, it might have been singular, or it might have been plural. “I have had no [plural]” is equivalent to “I have not had any [singular or plural, as appropriate]”.
If the context dictates, your examples could all swing either way:
1bɑ: I’ve had no friend since leaving school (= I haven’t had a friend since leaving school, but if I had, I would here be thinking of just the one)
1bβ: I’ve had no friends since leaving school (= I haven’t had any friends at all, but if I had, there would probably have been more than just a single one)
2ɑ: I’ve had no trouble/difficulty/problem/error since switching (= I haven’t had the trouble/difficulty/problem/error [that we’re talking about] since switching, but since we’re talking about a specific thing, there would just be the one if I had)
2β: I’ve had no troubles/difficulties/problems/errors since switching (= I haven’t had any [unspecified] troubles/difficulties/problems/errors at all, but if I did, there might have been just one, or there might have been several different ones)
3ɑ: I’ve had no boss since March (= If I had, I would just have had the one, but he’s been out of the loop since March, so I’ve been without him)
3β: I’ve had no bosses since March (= Bosses come and go, but I haven’t had any of them at all since March)
And an even clearer case:
4ɑ: He was widowed at 28 and has had no girlfriend since (= We’re thinking of a proper monogamous, long-lasting relationship where she would be The Girlfriend)
4β: He was widowed at 28 and has had no girlfriends since (= He hasn’t gone out and had whatever number of relationships or girlfriends he might otherwise have had)
I do agree, though, that “The system has had no error since 2013” is quite an unlikely sentence. It takes rather a particular context to create a situation where there is some specific error being discussed and then have someone phrase a sentence about that error in that manner. Similarly, reforming the negation, it’s quite unlikely that you’d say “The system has not had the error since 2013”. It would be much more likely that the sentence would then be phrased as “The error has not occurred since 2013” or something like that. And if we are not talking about a specific error, the plural would be entirely expected.
In a slightly different context, it can work:
— “Yeah, John managed to figure out what was causing it and it looks like I’ve managed to get it fixed. I’ve had no error since then, at least.”
– but even here, different sentence structures are more likely.