Now we have two indeependent variables: global variable r and template argument r (which works the same as local variable).
The result is that it occupies twice as much memory, which is inneficient, thus Uppaal discourages that.
You have three options:
a) spare the parameter and use the global variable r: declare the template parameter as reference "myRecord& r" which will bind to the global variable.
b) use global variable r as special value for initialization only, thus declare it as const: "const myRecord r = {0,0};".
c) insist on having two copies:
const myRecord r_const = {0,0}; // does not occupy state memory
myRecord r = r_const; // r is initialized with r_const and occupies state memory
P = Template(r_const); // parameter is initialized with r_const
Independent int variables do not work either. Perhaps you used literal values which are const int?
i.e. they are not changing and thus do not occupy state memory.