I am used this code for achieve this in past. Also tested latest version, try it. Its worked well.
add this code end of the theme function.php file
<?php
function cust_redirect_on_item_not_exists($item) {
if( count($item) == 0 ) {
$category = Category::newInstance()->findBySlug(preg_replace('~^.*/(.*)/.*$~', '$1', $_SERVER['REQUEST_URI']));
osc_redirect_to(osc_search_url(array('sCategory' => $category['pk_i_id'])), 301);
exit;
}
return $item;
}
osc_add_filter('pre_show_item', 'cust_redirect_on_item_not_exists');
?>