As far as I can see, SDL_SetWindowMouseGrab only works with a software cursor, and a hardware cursor is unaffected by this.
The mouse can still be restricted manually in Windows using ClipCursor. However, it would be nice if there was an automatic and platform-agnostic way of doing this.