Index: /trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
===================================================================
--- /trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php	(revision 53768)
+++ /trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php	(revision 53769)
@@ -2027,5 +2027,5 @@
 
 		if ( in_array( $post->post_type, array( 'post', 'page' ), true ) || post_type_supports( $post->post_type, 'revisions' ) ) {
-			$revision        = wp_get_lastest_revision_id_and_total_count( $post->ID );
+			$revision        = wp_get_last_revision_id_and_total_count( $post->ID );
 			$revisions_count = ! is_wp_error( $revision ) ? $revision['count'] : 0;
 
@@ -2036,5 +2036,6 @@
 
 			if ( $revisions_count > 0 ) {
-				$last_revision                = $revision['revision'];
+				$last_revision = $revision['revision'];
+
 				$links['predecessor-version'] = array(
 					'href' => rest_url( trailingslashit( $base ) . $post->ID . '/revisions/' . $last_revision ),
Index: /trunk/src/wp-includes/revision.php
===================================================================
--- /trunk/src/wp-includes/revision.php	(revision 53768)
+++ /trunk/src/wp-includes/revision.php	(revision 53769)
@@ -529,25 +529,25 @@
 
 /**
- * Get latest revision and count of revisions for a post.
+ * Returns the latest revision ID and count of revisions for a post.
  *
  * @since 6.1.0
  *
- * @param int|WP_Post|null $post Optional. Post ID or WP_Post object. Default is global $post.
+ * @param int|WP_Post $post Optional. Post ID or WP_Post object. Default is global $post.
  * @return WP_Error|array {
- *     Returns associative array with last revision and total count.
- *
- *     @type int $revision The last revision post id or 0 if non existing.
- *     @type int $count The total count of revisions for $post_id.
+ *     Returns associative array with last revision ID and total count.
+ *
+ *     @type int $revision The last revision post ID or 0 if no revisions exist.
+ *     @type int $count    The total count of revisions for the given post.
  * }
  */
-function wp_get_lastest_revision_id_and_total_count( $post = null ) {
+function wp_get_last_revision_id_and_total_count( $post = 0 ) {
 	$post = get_post( $post );
 
 	if ( ! $post ) {
-		return new WP_Error( 'revision_error', __( 'Invalid post.' ) );
+		return new WP_Error( 'invalid_post', __( 'Invalid post.' ) );
 	}
 
 	if ( ! wp_revisions_enabled( $post ) ) {
-		return new WP_Error( 'revision_error', __( 'Revisions not enabled.' ) );
+		return new WP_Error( 'revisions_not_enabled', __( 'Revisions not enabled.' ) );
 	}
 
Index: /trunk/tests/phpunit/tests/post/revisions.php
===================================================================
--- /trunk/tests/phpunit/tests/post/revisions.php	(revision 53768)
+++ /trunk/tests/phpunit/tests/post/revisions.php	(revision 53769)
@@ -657,5 +657,5 @@
 
 	/**
-	 * Tests that wp_get_lastest_revision_id_and_total_count() returns last revision id and total count.
+	 * Tests that wp_get_last_revision_id_and_total_count() returns the last revision ID and total count.
 	 *
 	 * @ticket 55857
@@ -675,10 +675,10 @@
 		$post_revisions     = wp_get_post_revisions( $post_id );
 		$last_post_revision = current( $post_revisions );
-		$revision           = wp_get_lastest_revision_id_and_total_count( $post_id );
+		$revision           = wp_get_last_revision_id_and_total_count( $post_id );
 
 		$this->assertSame(
 			$last_post_revision->ID,
 			$revision['revision'],
-			'Failed asserting latest revision id.'
+			'The last revision ID does not match.'
 		);
 
@@ -686,23 +686,25 @@
 			count( $post_revisions ),
 			$revision['count'],
-			'Failed asserting total count of revision.'
-		);
-	}
-
-	/**
-	 * Tests that wp_get_lastest_revision_id_and_total_count() when no revisions.
+			'The total count of revisions does not match.'
+		);
+	}
+
+	/**
+	 * Tests that wp_get_last_revision_id_and_total_count() returns a WP_Error when no revisions exist.
 	 *
 	 * @ticket 55857
 	 */
 	public function test_wp_get_last_revision_id_and_total_count_no_revisions() {
-		$revision = wp_get_lastest_revision_id_and_total_count( null );
-		$this->assertWPError( $revision, 'Invalid Post, non existing revisions.' );
-		$this->assertSame( $revision->get_error_message(), 'Invalid post.' );
+		$revision = wp_get_last_revision_id_and_total_count( null );
+
+		$this->assertWPError( $revision, 'Invalid post, no revisions should exist.' );
+		$this->assertSame( $revision->get_error_code(), 'invalid_post' );
 
 		add_filter( 'wp_revisions_to_keep', '__return_zero' );
 		$post_id  = self::factory()->post->create();
-		$revision = wp_get_lastest_revision_id_and_total_count( $post_id );
-		$this->assertWPError( $revision, 'Revisions should be not enabled.' );
-		$this->assertSame( $revision->get_error_message(), 'Revisions not enabled.' );
+		$revision = wp_get_last_revision_id_and_total_count( $post_id );
+
+		$this->assertWPError( $revision, 'Revisions should not be enabled.' );
+		$this->assertSame( $revision->get_error_code(), 'revisions_not_enabled' );
 	}
 
