The rctx is not checked and could be nil if the function isn't used with a chi.Router.
It ends up in a panic.
PR: #786
Additional point: the cleaning only happens in the rctx.RoutePath is an empty string. If a function like GetHead¶ is called before it won't clean the path.