You can do this in far less lines and in a supported manner. Instead of modifying the character’s walk speed, go after the actual control bindings themselves.
local ContextActionService = game:GetService("ContextActionService")
local REMOVE_BINDS = {"moveForwardAction", "moveLeftAction", "moveRightAction"}
for _, actionBinding in ipairs(REMOVE_BINDS) do
ContextActionService:UnbindAction(actionBinding)
end