When you use the WolframLibraryData::Message method with a "tag", the message issued uses LibraryFunction as the function; it calls Message[ MessageName[ LibraryFunction, "tag"]]. So it's less versatile than the math link version.
src = "
#include \"WolframLibrary.h\"
DLLEXPORT int issueMessages(WolframLibraryData libData,
mint Argc, MArgument *Args, MArgument Res) {
libData->Message(\"rnoset\");
return LIBRARY_RANK_ERROR;
}
";
<< CCompilerDriver`
lib = CreateLibrary[src, "messageLibrary"];
messageFunc = LibraryFunctionLoad[lib, "issueMessages", {}, "Void"];
This function generates two messages, one from the libData->Message(\"rnoset\"); call and one from returning a certain value.
In[5]:= messageFunc[]
During evaluation of In[5]:= LibraryFunction::rnoset: The function was executed but it failed to set a value for the result.
During evaluation of In[5]:= LibraryFunction::rnkerr: An error caused by inconsistent tensor rank was encountered evaluating the function issueMessages.
Out[5]= LibraryFunctionError["LIBRARY_RANK_ERROR", 2]
So in this example, nowhere does the library does not know the symbol name messageFunc - in your example the library never has access to the symbol name MyFunction.