Task.remove() task keeps running

I experience a bug when I call task.remove(), the task keeps running. I think, I know why and I want to be sure…
Panda/task loop can execute the task after I called task.remove() and because the task function at the end sends task.cont, it will keep running. Is it correct?

edit: I was adding the same task twice so I guess that wasnt it.

No, if you call task.remove(), it will be removed regardless of the return value. Can you show some example code that shows the problem?

Sorry, if it wasnt clear from the edit, I was adding the same task twice, so that was the bug. I was removing only one.