Seems you are mixing component and regular vectors:
julia> vcat(params_chiphi, params_pe) |> typeof
Vector{Float64} (alias for Array{Float64, 1})
Thus, concatenating two component vectors is no longer a component vector. Accordingly, when you fetch part of the vector as NN_params1 = NN_paramsf[1:l1] in ODE_model this is also just a regular vector and does not have a component layer_1 etc.
Instead, you might want to construct a combined component vector, e.g.,
NN_params = ComponentVector((chiphi = params_chiphi, pe = params_pe))
Then, there is also no need to manually slice the parts in ODE_model as you can just fetch the named components:
NN_params1 = NN_paramsf.chiphi
NN_params2 = NN_paramsf.pe