First, this question might be better suited for the EHL forum but let's see how it fares here.
I suppose you're wondering why we say Hagi with a long I and not a short I as you quoted, in mergi. Of course people are entitled to a particular spelling and pronunciation of their names for personal or historic reasons.
Hagi or Hagiu comes from the Turkish language and you can read all about it here. The name Hagi-Tudose from Barbu Ștefănescu-Delavrancea's short story is pronounced with the same long I but that's all I can offer.
Long story short, Romanian orthography does not have (currently) 2 distinct characters for 2 distinct sounds: long i and short i,
which leads to confusions like in your example.
(native speakers don't have a problem in reading correctly such cases)
The long story:
Romanian language was written in Cyrillic alphabet during Middle Ages, then in a "transitional alphabet" between 1848 - 1860 and finally in Latin alphabet since 1860.
There were many debates during 19th century for defining an orthography that would cover all Romanian phonemes, but also not being too complex.
In the beginning the orthography was very complex, with many diacritics used to differentiate long and short vowels, diphthongs and hiatus and so.
An example of this orthography here:
You may notice the short i represented as ĭ, while the long i is a simple i.
In this orthography we would spell Hagi and mergĭ.
In 1860 around 80% of the population (the peasentry) was illiterate. The people who could read and write were from the nobility, well educated, speaking also French or other foreign languages. For them there was no problem to accommodate such a complex orthographic system.
After some decades the percentage of literate population increased, but the children could not spell correctly in schools. Teachers asked for orthographic reforms, i.e. simplification.
There were over 40 orthographic changes during 150 years. Some were very small changes, other were more radical.
And today we have a system which seems to be simple for native Romanians (but it still leads to confusions and errors)
and I guess that is a nightmare for foreigners.
Examples of confusions in current orthographic system: El auzi un sunet. ('auzi' is a verb in perfect simple tense, with a long i) Tu auzi ceva? ('auzi' is a verb in present tense, with a short i)
Să fii bun. ('fii' is pronounced with a long i, although it is spelled with 2 i-s) Nu fi prost! ('fi' is pronounced the same as 'fii' above, with a long i, but is spelled with a single i)