Can you re-post this using a code block, (three back ticks (```) before and after the code) so that we can see the white space you’ve used?
I can’t see any issue with what you’ve posted unless there is missing white space?
I’ll note the Robot Framework User Guide for Setting custom name to library does mention that the WITH NAME was deprecated in version 6.0, so if you are using version 6.1 perhaps that might be the issue?