Someone else may have a better answer for you but I'm responding because no one else has as yet and this will keep your post "live" one more day.
The bottom line is that these trim/tilts are just plain hard to troubleshoot......hydraulically......especially when the outboard is on a boat in the water.
You have already done the main...and easiest...check which is the manual valve.
There are a couple of possibilities.....air in the system or, the internal bleed check valve is going bad or sticking open. Since it's so intermittent, I would guess it's the valve sticking.
Air in the system would indicate a leak of some sort. It could be pulling air through the ram seal. But, again, proving that is tough. Even properly checking the fluid level is difficult in the water and so finding bubbles of air in the fluid may prove impossible. If you can get to the reservoir fill plug and make sure the unit is full of fluid that's about all I would think you could do.
If it's full, then it's probably the check valve. If so, I would just tilt it up and use the tilt lock and not worry about it. The check valve wasn't really meant to hold the outboard up indefinitely anyway and the tilt lock SHOULD be used for trailering or uptilted storage.
Good luck.