Find part on ray does not return a hitpart

Im making my own gun system, but right now im having issues with the raycasting, I think its an issue with my spread as it never returns a part thats been hit

Server Code

local ServerScriptService = game:GetService("ServerScriptService")
local ServerStorage = game:GetService("ServerStorage")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local Debris = game:GetService("Debris")

local GunStats = require(ServerScriptService:WaitForChild("GunStatsModule"))

local Fire = ReplicatedStorage:WaitForChild("Fire")
local Reload = ReplicatedStorage:WaitForChild("Reload")
local Store = ReplicatedStorage:WaitForChild("Store")
local UnStore = ReplicatedStorage:WaitForChild("UnStore")

local GunFlash = ServerStorage:WaitForChild("GunFlash")

function GetAmmo(Player, Gun)
	for i,v in pairs(ServerStorage:GetChildren()) do
		local G = ServerStorage:FindFirstChild(Gun.Name)
			if G then
			if G.User.Value == Player then
				return G
			end
		end
	end
	
	return nil
end

function FireShoot(Player, Gun, MousePos)
	print("Firing")
	
	local Stats = GunStats:GetWeaponStats(Gun.Name)
	local FirePart = Gun:FindFirstChild("FirePart")
	local Ammo = GetAmmo(Player, Gun)
	
	local Character = Player.Character
	local Humanoid = nil
	if Character ~= nil then
		Humanoid = Character:FindFirstChild("Humanoid")
	end
	
	if Stats ~= nil and FirePart and Ammo ~= nil and Character ~= nil and Humanoid ~= nil then
		print("Passed 1st check")
		if Ammo.Value ~= 0 and Humanoid.Health ~= 0 then
			print("Passed 2nd check")
			Ammo.Value = Ammo.Value - 1
			
			local frame = MousePos * CFrame.Angles(math.random(0, Stats.Spread), math.random(0, Stats.Spread), 0)
			
			local ray = Ray.new(FirePart.Position, frame.Position)
			
			local hitpart, hitposition = workspace:FindPartOnRay(ray, Gun, false, true)
			
			if hitpart then
				print("Hit something")
				local TargetPlayer = Players:GetPlayerFromCharacter(hitpart.Parent)
				if TargetPlayer then
					print("found target player")
					local TargetHuman = TargetPlayer.Character:FindFirstChild("Humanoid")
					print("found target human")
					if TargetHuman then
						if TargetPlayer.TeamColor ~= Player.TeamColor then
							print("Damaging")
							TargetHuman:TakeDamage(Stats.Damage)
						end
					end
				end
			end
			
			print("Making flash")
			
			local FlashClone = GunFlash:Clone()
			FlashClone.Parent = FirePart
			
			Debris:AddItem(FlashClone, 0.1)
			
			if Stats.FireSound ~= nil then
				print("Making Sound")
				
				local FireSFX = Instance.new("Sound")
				FireSFX.Parent = FirePart
				FireSFX.SoundId = "rbxassetid://" .. Stats.FireSound
				FireSFX:Play()
				
				Debris:AddItem(FireSFX, 2)
			end
		end
	end
end

function StoreServerAmmo(Player, Gun)
	local Ammo = GetAmmo(Player, Gun)
	if Ammo == nil then
	
		local Stats = GunStats:GetWeaponStats(Gun.Name)
	
		local NValue = Instance.new("IntValue")
		NValue.Parent = ServerStorage
		NValue.Name = Gun.Name
		NValue.Value = Stats.MaxAmmo
	
		local use = Instance.new("ObjectValue")
		use.Value = Player
		use.Parent = NValue
		use.Name = "User"
	
		print("Created Ammo")
	end
end

function RemoveSeverAmmo(Player)
	for i,v in pairs(ServerStorage:GetChildren()) do
		local user = v:FindFirstChild("User")
		if user then
			if user.Value == Player then
				v:Destroy()
			end
		end
	end
	
	print("Removed Ammo")
end

function ReloadGun(Player, Gun)
	local Stats = GunStats:GetWeaponStats(Gun.Name)
	local Ammo = GetAmmo(Player, Gun)
	
	if Stats ~= nil and Ammo ~= nil then
		wait(Stats.ReloadTime)
		Ammo.Value = Stats.MaxAmmo
		
		print("Reloaded")
	end
end


Fire.OnServerInvoke = FireShoot
Reload.OnServerInvoke = ReloadGun
Store.OnServerInvoke = StoreServerAmmo
UnStore.OnServerInvoke = RemoveSeverAmmo

Client Side Code (quickly thrown together to test if server side works)

local ReplicatedStorage = game:GetService("ReplicatedStorage")

local ContextActionService = game:GetService("ContextActionService")

local Fire = ReplicatedStorage:WaitForChild("Fire")

local Reload = ReplicatedStorage:WaitForChild("Reload")

local Store = ReplicatedStorage:WaitForChild("Store")

local UnStore = ReplicatedStorage:WaitForChild("UnStore")

local Player = game.Players.LocalPlayer

local Character = Player.Character or Player.CharacterAdded:Wait()

local Humanoid = Character:WaitForChild("Humanoid")

local Mouse = Player:GetMouse()

Humanoid.Died:Connect(function()

UnStore:InvokeServer()

end)

script.Parent.Equipped:Connect(function()

Store:InvokeServer(script.Parent)

end)

script.Parent.Activated:Connect(function()

Fire:InvokeServer(script.Parent, Mouse.Hit)

end)

function yes()

Reload:InvokeServer(script.Parent)

end

ContextActionService:BindAction("reload", yes, false, Enum.KeyCode.R)

You could try positioning a part at hitposition to see where your raycasts are ending and then debugging from there.

They seem to be landing in the correct position, but it still wont return a part.