I tried this formula button on a new record, and then repeatedly editing the same record. It worked as expected every time (saved and loaded the same record again):
var text rid =
If([Record ID#]>0,
ToText([Record ID#]), // Record ID already exists
"%%rid%%" // New record, no Record ID exists yet
)
;
var text url = URLRoot() & "db/" & Dbid() & "?a=er&rid=" & $rid;
"<a class='Vibrant Primary SaveBeforeNavigating' data-replaceRid=true href='" & $url & "'>Save & Keep Working - Rich Text</a>"
Have you tried a different device just to rule out that it's a local issue?