I use almost exactly the same code to create my blocks.
There is a minor difference in that I don't use swModelDocExt.SelectAll - I make sure that I manually select the sketch entities before creating the SketchBlockDefinition.
The other difference is that my code is in a VBA macro. Hopefully that won't be the issue though.
Try manually selecting the sketch entities and see if that makes a difference. If it does, then you'll have to programmatically select them instead of doing a SelectAll.