Thanks Virtual Nomad and pavelman.
I'm getting somewhat closer, when I omit the SetObjectColor() command the code works as expected.
@pavelman: Switching Swap() -> Sync() doesn't make a whole lot of difference because Sync() does a Swap(). I have deleted update() from the code.
So, this works, uncomment the SetObjectColor line and the image is empty. I have no idea why this is happening. Is this a bug, or is this perfectly explainable? Either way, does anyone knows how to take a screenshot with a object colors instead of textures?

+ Code Snippet// Project: TestScreenshot
// Created: 2022-07-26
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "TestScreenshot" )
SetWindowSize( 800, 800, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 800, 800 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
CreateObjectBox(1, 1, 1, 1)
//SetObjectColor(1, 255, 0, 0, 0) -> Uncomment this line and the image is empty.
SetCameraPosition(1, 0, 2, 0)
SetCameraLookAt(1, 0, 0, 0, 0)
DO
Render()
img = GetImage(0, 0, 800, 800)
SaveImage(img, "test.png")
Swap()
End
LOOP