You are using string:sub when you should be using string.sub. The error is a bit unintuitive as : is passing “itself” to the function sub causing the first argument to be a table and not the string (which will now be the second).
There is no access for Roblox / Lua internal functions so you are not able to step into the function call.
A quick example
local foo = {}
function foo:bar()
return true -- can step into
end
local part = Instance.new('Part')
local a = 'foo'
-- can only debug function bar
if foo:bar() and part:IsA('Part') and string.sub(a, 1, 3) == 'foo' then -- breakpoint
end
Yeah this was in the backlog for a little bit; the issue isn’t so much the error location, but that the error message here needs to be more descriptive.