It could be that you’re trying to call the function before it gets initialized. Scripts will get initialized in the exact order you declare in the [client/server]_scripts call.
Example:
client_scripts {
"client/main.lua",
"shared/util.lua",
}
If you try to use a function in citizen/main.lua but it requires a function from shared/util.lua you’re going to error because that script has not been interpreted yet, this should only happen right after the script has started though.
This can also happen if the function is declared as a local function which means it only exists in the local context of that file (so if the local function was declared in shared/util.lua, only shared/util.lua would be able to use it