I can confirm this issue. This seems to be a regression in SW 2017. I have tried the following code: #CODE|Rename Active Model and Reload and it works in SW 2015, SW 2016 but not in SW 2017 (gives the same error).
Yep. Same thing here. 2016 works fine. 2017 does not. I just tried it with 2017 SP2 and the problem is still there.
Also confirmed by SOLIDWORKS API support as a regression. SPR 1009156 has been issued.