... I was wondering if it's possible for a foreigner like me to find office work in Indonesia ...
Theoretically only legally possible if you have a skill that Indonesians don't have .
And to make it even more difficult , the salaries of Indonesian workers are very small (see here
https://www.bps.go.id/en/statistics-table/2/MTUyMSMy/average-of-net-wage-) , and there are so many without job .
------------------------------
Work Regulation PP no.34 Year 2021 - free translation
Every employer must prioritize the use of Indonesian workers in all types of available positions.
Foreigners can only be employed by 'big companies' in a working relationship for a certain position and a certain time, and must be qualified for the position to be occupied.
Employers of foreign workers are prohibited from employing foreigners in human resources department and other positions to be defined.
-------------------
Work Regulation PerMen no.10 Year 2018 - free translation
Article 5
A foreign worker must :
a. have education diploma that is related to the qualifications required for the work position ;
b. have a competency certificate or work experience of at least 5 years related to the qualifications required for the work position ;
c. transfer his/her expertise to a designated Indonesian worker;
-------------------
Law UU no.13 Year 2003 - free translation
CHAPTER VIII - EMPLOYMENT OF FOREIGN WORKER
Article 42
(1) Every company that employs foreign worker is under an obligation to obtain written permission from Manpower & Immigration Ministers .
(2) An individual person is prohibited from employing foreign worker.
....
Article 185
(1) Every person who violates what is stipulated under subsection (1) and subsection (2) of Article 42, Article 68, Article 69, Article 80, Article 82, ... will be subjected to a criminal sanction in jail for a minimum of 1 year and a maximum of 4 years and/or a fine of a minimum of Rp100 million and a maximum of Rp400 million .
-------------------
Law UU no.6 Year 2011
Article 122
Shall be punished with imprisonment of up to five years and fined at most Rp500 million :
a. any foreigner who deliberately misuses or engages in activities not in accordance with the intent and purpose of his/her Visa/Stay Permit;
b. any person who ordered or provide opportunity for the foreigner to misuse or engage in activities inconsistent with the intent or purpose of the Visa/Stay Permit given to the foreigner.
... my dream is to relocate to Indonesia ...
If you cannot get a job under the above restrictions , you still have the option to work informally if you marry an Indonesian .
For example , you could work informally in your Indonesian spouse's small business .
More details at
https://www.expatindo.org/community/threads/remote-work-with-a-spouse-kitas-visa-the-how.7856/