Seems that the solution is to unlink and relink repository.
As per this forum thread, it looks like a version of ruby linked to the old image is pinned by default.
Unlinking and relinking the repository reset the correct default versions for the new image.
On a side note, the linked thread says that Ruby will be automatically set to 2.7.2 upon changing the build image, but I didn’t see that behaviour.