Template tag evaluates differently on local vs server

I have Django 5.1.1 on both my local machine (windows 11) and the server (Ubuntu 20.04). The code I have is the same for both local and server:

<script>
    const is_manager = /^true/i.test('{{request.user.is_employee_manager}}');
</script>

Both local and server uses the same exact database.

Yet on the server the template evaluates to: <script>const is_manager = /^true/i.test('');</script>

and local template evaluates to: <script>const is_manager = /^true/i.test('True');</script> or
<script>const is_manager = /^true/i.test('False');</script> depending on the user.

Model:

class User(AbstractUser):
    birth_date = models.DateField(null=True, blank=True)
    password_changed = models.DateTimeField(null=True, blank=True)

    @property
    def is_employee_manager(self):
        return self.is_in_group(r'Employee Admin')

    def is_in_group(self, pat):
        if self.is_superuser or self.groups.filter(name__iregex=pat).exists():
            return True
        return False

This is very strange bug. Currently I’m passing the request.user.is_employee_manager in a separate context in the view as {'is_manager': request.user.is_employee_manager } and this hotfixes the issue.

Any help in trying to figure out what’s going on here would be greatly appreciated.

What are all the differences between the two environments?

What differences are there between the settings files?

How are you running your project in each location?

What versions of Python are being used in each location?

Specifically, what your symptoms imply are a difference in the context being used for rendering in the two environments, which could be caused by a difference in the installed apps, context processors, rendering engine, templates, or possibly even something else.

Identifying all the differences between the two is the first step to finding the answer.