I don't think this solves your issue specifically, but:
I have found that this works if I call library
directly
library(KFAS)
model_good <- KFAS::SSModel(ts ~ -1 + SSMcustom(Z = Z_t, T = T_t, R = R_t, Q = Q_t, a1 = a1_t, P1 = P1_t)
And this does not if I try to use KFAS::SSMcustom
instead. This returns the same error message that you describe.
model_good <- KFAS::SSModel(ts ~ -1 + KFAS::SSMcustom(Z = Z_t, T = T_t, R = R_t, Q = Q_t, a1 = a1_t, P1 = P1_t)
(sorry if this isn't the best way to post an "answer", I don't have enough reputation to add a comment it appears)