방금 has its hanja "方今", which doesn't means "just now" but nowadays in neither ancient Chinese nor modern Chinese.
The standard dictionary has the three definitions of 방금(方今):
- the moment (right) before one speaks
- the moment when one is speaking
- the moment (right) after one has spoken
At present, however, 방금 mostly refers to the first one, as you can see from what people say. A dictionary says that 方 of 方今 means 바야흐로, but 바야흐로 does not explain the how 方今 became to mean "only a short time ago."
No answers would be absolutely correct to your question. In the comment section above, I left a few links for you to read some people's opinions (For the late 정재도's, I found this post and this document as well). Among them, I would support the idea that 방금 has been a native word and add that 方今 was semantically the same in both languages. I suppose that lexicographers merged 방금 and 方今 into one word while compiling dictionaries because the sound of 方今 is the same as 방금 and 今 means now. This seems to be the reason that Korean 방금 and Chinese 方今 are different in meaning.
In Korea, 方今 meant "at the moment" or "at present" as shown in the following:
(Translation in modern Korean: ... 500년 동안 왕도(王道)정치가 펼쳐지던 나라에 왜인(倭人)들이 득세를 하여 억조창생이 덕화(德化)를 입지 못하고 있습니다. 천리의 방기(邦畿)가 어떤 지경에 이르렀습니까? 도탄에 빠진 백성들이 어떻게 편안하게 살 수 있겠습니까? 지금 도중(道中), 동학의 본뜻은 왜를 물리치는 것입니다.)
...그리하여 마침내는 오늘날 같은 다 쓸어지는 어려운 지경에 이르렀으니, 우리 동포(同胞)로서 혈기(血氣)가 있는 자라면 어찌 한심(寒心)스럽게 여기고 통곡하지 않을 수 있겠는가?
방금(方今) 천하의 대세(大勢)는 군웅(群雄)들이 서로 잘난체 하여 저희끼리 서로 시기하고 서로 좋아하며, 서로 이기고 서로 조심한다....
Someone may claim that the meaning of 方今 has expanded in the Korean language, but is it true?
A Korean writer 이광수 wrote some stories using both Hangul and Hanja characters in the way shown below as an image. In "어린 벗에게" (1917) (the full text here), which is one of his short stories, he used 방금 not 方今 to say "only a short time ago". This suggests that 방금 is actually not Chinese because he used Hanja characters only for all of the Sino-Korean words in the story. Now, one may ask: "Did he forget to use 方今 there?" My answer would be: "I do not think so because there was an editor."
On a side note, he used 只今 ("right now") and 至今 ("up to this day" or "now") in another story titled "尹光浩" (1918), which clearly shows that he used Hanja characters thoroughly, even for temporal adverbs, at least in these two stories. Although 정재도 claimed in 2005 that 지금 is irrelevant to Chinese or Japanese 只今, it is true that 이광수 had used 只今:
...내가 只今 무슨 말을 하던가....
...만일 只今이라도 어떤 부드러운 女子의 손이 悲憤과 失望으로 破裂하려 하는 光浩의 가슴을 만져 주면 光浩는 蘇復할 餘望이 있으리라....
In "佛蘭西 家庭은 얼마나 다를가" (1936), 나혜석 used 方今 to say "at present". You should note that this 方今 is connected to the word conjugated as "잇스며" ("있으며" now).
Korean writers at that time used either Hangul or Hanja characters (or both) where Sino-Korean words were put, as you can see in the following example (old news articles here):
재작이십사일 오후열두시 삼십분경에 마포(麻浦)를 출발하야...
The author used no Hanja characters for 다행, 승객, 무사, 원인, 방금, 조사, and 중 in the subtitle. This 방금 means "at present" (方今) because of the word 중(中).
It seems to me that using Hangul in this way made 방금 and 方今 easily confusable. The Japanese occupation (1910–1945) of Korea may also have had an influence on the use of 方今 (One of the meanings of Japanese 方今(ほうこん) is "only a short time ago"), but there is no way for me to know the main cause. In the following, 方今 means "only a short time ago":
北朝鮮視察旅行 으로부터方今돌아온 宇垣總督은 十六日 沈痛한 顏色으로 아레와가티 말하얏다
In general, however, the meaning of 方今 and its sound, 방금, in news articles remained "at present" until about 1970; since 1980 or so, the meaning of 방금 (There is no more 方今) has been "only a short time ago" not "at present." Although 방금 전 (meaning "only a short time ago") is used even in 2020, I strongly believe that it is a pleonasm because 방금 후 has never been used in news articles. Thus, I would claim that Chinese 方今 is actually obsolete in South Korea.
In 조선말 큰사전 (1957), 방금(方今) is defined as follows:
방금(方今) 【엊】 마침 이제. (방장=方將②. 방재=方在).
It shows that the adverb 方今(방금) did not mean "only a short time ago." In this dictionary, no other definitions say that 방금 means "only a short time ago," which implies that most Koreans used the Sino-Korean word, 方今, to mean "at this (very) moment" only.
To make my opinion more convincing, I may have to find more examples. Please correct the errors if there are any.