Tracking Stopped Working

Your software
My Mautic version is: 4.1.0
My PHP version is: 7.4
My Database type and version is:

Your problem
My problem is:

We upgraded an instance of Mautic to 4.1.0 and everything was working the way it should. It worked for about a week or so and then all of a sudden tracking stopped working today.

I am not seeing anything in the mautic.error log. On the Wordpress side I am seeing a 500 error in the console:

I have CORS enabled and in the mautic.access log I see the following:

99.99.99.99 - - [20/Dec/2021:17:43:14 +0000] "GET /mtc.js HTTP/2.0" 200 100660 "https://domain.co.za/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"

99.99.99.99 - - [20/Dec/2021:17:43:15 +0000] "OPTIONS /mtc/event HTTP/2.0" 204 0 "https://domain.co.za/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"

99.99.99.99 - - [20/Dec/2021:17:43:15 +0000] "POST /mtc/event HTTP/2.0" 500 55197 "https://domain.co.za/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"

99.99.99.99 - - [20/Dec/2021:17:43:15 +0000] "GET /mtracking.gif?page_title=Home%20-%20World%20Tour&page_language=en-US&preferred_locale=en_US&page_referrer=&page_url=https%3A%2F%2F domain.co.za%2F&counter=0&timezone_offset=-120&resolution=1920x1080&platform=MacOS&do_not_track=false&timezone=Asia%2FJerusalem HTTP/2.0" 500 65049 "https://domain.co.za/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36"

Steps I have tried to fix the problem:
Tracking was enabled via WP plugin WP-Mautic. Also added the entire script to the header.
Added index.php to the end of my mautic url
chown -R www-data:www-data entire mautic directory
cleared cache between each change of action

@robm

Does anyone have any ideas here ? could this be a CORS issue ? Any idea how to go about troubleshooting this ?

We never did figure this out but upgrading to the latest version did the trick.