I don't know what you did.
But all you have to do to create pagination links is to call the method with appropriate arguments.
PHP Code:
$pager->makeLinks($page, $perPage, $total)
It might be good to forget about CI4 Model pagination.
Or if you want to do something like CI4 Model pagination,
read BaseModel::paginate() method, and override it for your need.