Strange behaviour of bash script cron job under Alma 9

Hello to AlmaLinux Comminity !

A month ago I’ve migrated my server from CentOS 7 to AlmaLinux 9 (NOT “elevating from CentOS” at place - but clean installation of A9 and step-by-step migration)

I’ve wrote simplest bash script to check if /usr/sbin/pflogsumm not suddenly updated and contains my own DB insert commands - as follows

#!/bin/bash
version=$(ack “Release 1.1.5” /usr/sbin/pflogsumm | wc -l) ; echo $version ;
dbexist=$(ack “dbstore” /usr/sbin/pflogsumm | wc -l) ; echo $dbexist ;
if [[ “$version” -eq “0” ]] && [[ “$dbexist” -eq “0” ]] ; then
echo “Version CHANGED and DB insert not exists”;
else
echo “PFLOGSUMM Version still 1.1.5 and DB INSERT at place”;
fi
exit ;
sh

I’ve added cron job to the file
/var/spool/cron/root
35 10 * * * sh /a/pflogsumm_keep/pflog_check.sh > /a/pflogsumm_keep/result.txt ;

The problem is - if I run the script directly from shell - we have result file with content
version count = 1
dbexist count = 5
PFLOGSUMM Version still 1.1.5 and DB INSERT at place

BUT if same command run from cron job - then we have result file with content
version count = 0
dbexist count = 0
Version CHANGED and DB insert not exists

The question is - HOW IT COULD HAPPEN ?
AS IF crond service using /var/spool/cron/root has not enough of the root privileges to perform commands in BASH script or something like that.
Under CentOS 7 I never met such a problem.
Would be very obliged for the ideas how to fix such a situation.
Regards,
Serge

Answering my own question - a specific reason of such a behavior was found with StakOverflow assistance - see details there
It was not about Almalinux at all, but a special using of ACK command.