As Luke pointed out , the brackets are mandatory.
If it does not parse with brackets it is 99.99% due to the fact that you passed a non-null terminated wchar_t string.
The documentation mentions the provided string to be null terminated
A pointer to the NULL-terminated network string to parse.
https://learn.microsoft.com/en-us/windows/win32/api/iphlpapi/nf-iphlpapi-parsenetworkstring