The following executes just fine:
catalog:withWriteAccessDo ("CreateKwUnderPerson", function() name = "test123" akw = catalog:createKeyword (name, {}, true, nil, true) end)
However, if instead "name" is assigned nil, then it produces "assertion failed!". So verify that "name" is a string.
Also, are you using a debugger of some sort, e.g. my Debugging Toolkit or the IDE debugger described in another thread here? They both take some time to hook up initially, but they'll save you a huge amount of time down the road, given the nature of Lua.