Opposition captain Sarel Burger won the toss and elected to bat first under overcast but dry skies in the Scottish capital.
Stephan Baard (78) and Zane Green (61) gave Namibia a strong platform with 124 runs in the 18th over.
Sharif dismissed Baard caught behind while Mark Watt claimed Green and Gerhard Erasmus, with the score on 188 with 19.1 overs remaining.
Handy contributions from Jan Frylinck (42), Craig Williams (69*), Christi Viljoen (13) and Smit (18*) towards the middle and end of the innings set Scotland up for a big chase, with 325 required to win.
Matthew Cross and Kyle Coetzer opened the innings and took the score to 42 before Cross got a leading-edge to short mid-wicket off the bowling of Viljoen.
Things got worse when Calum MacLeod was well caught by Lungameni for a two-ball duck. Richie Berrington, Scotland’s centurion from the first match, and Coetzer then put on 117 runs to keep their side in contention.
The rain then arrived and halted play for 18 minutes and when the sides returned, a delivery from Bernard Scholtz beat the defences of Richie Berrington LBW for 61.
Coetzer went on to reach a well-made century, and on the way passed 4,000 List A runs. Unfortunately for the Scots they couldn’t build any real momentum after Coetzer was caught on the boundary for 112, with the score on 228/7.
Following one final rain-break, Scotland finished on 274/9 from 50 overs, 50 runs short of victory.
After the match captain Kyle Coetzer said, “It’s quite a tough one to take, I think the toss was quite crucial and they came out at the start and put us under pressure and were able to hit the boundaries early on and I thought Baard played a fantastic knock.
Coming into the second innings I thought they had 40 too many really, and thought par was 260/270, and in the second innings the wicket slowed up a little bit and started to turn and they took control with cutters and spinners.”
The result now leaves Scotland in third position in the World Cricket League Championship after Round 5. Scotland have four matches remaining in the competition, two against Papua New Guinea and two against Kenya away.
Scotland have a short time to regroup ahead of their two ODIs against Zimbabwe. Both fixtures are also being held at the Grange on Thursday 15 June and Saturday 17 June. Tickets are still available online via Eventbrite.