This does not look like a protobuf issue to me. Is it possible this is simply an issue that you haven't told Matlab how to find the protobuf DLL?
Where is the "could not find dll like" issue?
Beyond the scope of this list, I have ,
1. used vcpkg to acquire protobuf 3.21.12,
2. taken your model and modified the LIB_PATH and INC_PATH to point to location where vcpkg installed the protobuf headers and built libs,
3. rebuilt your s-function
The only issue I ran into is Matlab S-Function builder gave a vague error that it could not obtain sizes from the MEX file....
but that was because the MEX failed to build completely...
but that was because Matlab doesn't know where to find the protobuf DLL.
How are you making the protobuf DLL available to Matlab?
When I correctly provide the protobuf DLL to Matlab, I can see the value you assign and retrieve through the protobuf::Timestamp (the value, 2) in the outputs from your model.