Don't throw it away! It can be fixed.
Sound like you are experiencing intermittent transfer case failure. The park gear is on the output shaft of the transmission and when the vehicle quits moving and will not hold in park indicates that the failure is behind the transmission (transfer case, front or rear differential or axle shafts). There are two differentials and four axles, if one fails the transfer case will transfer power to the other and keep you moving. Most differential and axle failures are not intermittent and are associated with grinding type noises. This leaves the transfer case as the most likely component that is failing. This would be an internal mechanical failure within the transfer case. When you take your vehicle to the shop make sure you mention that when it fails it will not hold park. This is vital information to the diagnosis.