Has it ever ran to rated rpm or is it a new setup? Has anything been changed on the boat or engine that might affect it what engine is it?
Need more information to give any sort of accurate answer
Check the engine manufacturer's recommended WOT range & then run the boat with its normal load to see if it falls within that range with the current prop.
If it does & there are no other running issues then you don't have a problem.
If it's outside that range when under load then you need to look at replacing the prop with one with appropriate pitch to increase or decrease the WOT revs to fall within the spec.
An engine will rev higher with no load than with. You might also consider the effect of the different gears in your car on the engine revs which is much the same as changing the pitch of a boat propeller.
It's almost certainly out of rpm spec at 4000rpm
A make model & hp & boat size would be helpful it could be as simple as dirt in the carb causing it to drop a cylinder under load or a faulty plug lead or coil how long has it stood before your pal bought it
Any history with it
It's easy to jump on the "it's got the wrong prop" line but there are many things that can rob rpm the prop is just one of many