by Jenny Gray.
If you look at tag/index.php you can copy where the tagged_courses() function has already been used.
Basically you need to declare a renderer object and then call the function on it, something like this:
$courserenderer = $PAGE->get_renderer('core', 'course');
$courserenderer->tagged_courses(XXX);
You also need to pass the id number rather than a text string into the function, which will probably solve the fatal error.