If your local development environment is on Windows where there is not normally any case sensitivity, A is the same as a, then the likely problem is that in your code you have a class defined with either an uppercase or lowercase letter when it should be the other way around.
When you move the code to the production site then it is most likely a flavour of linux where case matters and then your class is not found, thus the Object is not created and whatever getGroup() is supposed to be found in doesn't exist, it is null, hence the message. Look at the Class, Namespace and Use statements for an incorrect case letter in the file where getGroup() is located.
If I am right about your local development environment being on Windows and you would like to prevent this issue you can make Windows folders case sensitive so that this issue would appear in development and not when you get to production. I wrote about how to do it here, https://notes.irataweb.com.au/how-to-programming/developer-tools-how-to/make-windows-10-folders-case-sensitive