Intermittent shift problems

Sounds like a sticking governor. With that being said theres usually a reason for it and thats metal contamination. Removing the pan should confirm if thats your problem. Also remove the filter and look on top of it for small bits of rubber as well.If either or both are evident an overhaul may be your next option.