Because memory is serialized any objects you put into it lose their prototype, so the next tick when you pull that position out, its no longer a RoomPosition. One of the checks involved in throwing the error you are getting is _.isPlainObject which would return false if the object has no prototype.One of several ways you can work around this is to pass the attributes you have stored in memory into the RoomPosition constructor to make a new RoomPosition object whenever you pull it out of memory. `let myNewPosition = new RoomPosition(myMemoryPosition.x, myMemoryPosition.y, myMemoryPosition.roomName);`
Also if you havent already, check out this link http://chat.screeps.com/ to get signed up for the https://screeps.slack.com/ slack team.There is a #help channel there where you can get pretty quick answers to questions like this.