Lazy cache not working in HeatmapSessionRecording

Hi there,
In the following file
plugins/HeatmapSessionRecording/Tracker/HsrMatcher.php , there is the following code snippet.

$lazyCache = \Piwik\Cache::getLazyCache();
$samplesKey = ‘hsrNumSamples’ . (int) $idSite . ‘_’ . (int) $idSiteHsr;
$numSamples = $lazyCache->fetch($samplesKey);

if ($hsr[‘record_type’] == SiteHsrDao::RECORD_TYPE_HEATMAP) {
if (empty($numSamples)) {
$numSamples = $logHsrSite->getNumPageViews($idSiteHsr);
$lazyCache->save($samplesKey, $numSamples, $ttlInSec = 300);
}

In the above code, the following if condition is always getting true. So, it means lazyCache is not working in our system.

if (empty($numSamples)) {

Can you please suggest some solution to make it work? From the above if check it seems it is not working at all, but is there any other way to cross check?
What can we do to make it work?

We are using Ubuntu 20.04.3 LTS as an operating system. Thanks for your time.

Kind Regards!
Hafiz Naser