A weird remote function returning nil

Sup, so I basically wanted to test out my game and I tried using my remote function, and everything serversided worked correctly, like all the actions and stuff. But for some reason the return is nil.

I tried putting a print before return and it printed fine, but no luck with returns

---- Server script
createTransaction.OnServerInvoke = function(player, modelName, typeOfShop)
...
  print("alrdy bought")
  return "already bought"
end

---- Local script

local outcome = game.ReplicatedStorage.Remotes.CreateTransaction:InvokeServer(modelName.Value, _G.TypeOfShop)
    
print(outcome)

I can’t upload picture for some reason here is output:

  01:02:12.577  alrdy bought  -  Server - CoolShop:218
  01:02:12.594  nil  -  Client - Buy:10
2 Likes

The return was inside a local function, I got it out and now it works